Skip to content

Commit

Permalink
add: documentation for phone number module
Browse files Browse the repository at this point in the history
  • Loading branch information
mrunderline committed Feb 27, 2021
1 parent 4ef4b23 commit 857fe52
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ An anthology of a variety of tools for the Persian language in Python
1. [card number](#card-number)
2. [sheba](#sheba)
5. [national id](#national-id)
6. [phone number](#phone-number)

## Usage
Let's take a look at what an example test case would look like using `persian-tools`.
Expand Down Expand Up @@ -178,3 +179,21 @@ national_id.generate_random() # '1156537101'
national_id.find_place('0906582709') # {'code': ['089', '090'], 'city': 'کاشمر', 'province': 'خراسان رضوی'}
national_id.find_place('0643005846') # {'code': ['064', '065'], 'city': 'بیرجند', 'province': 'خراسان جنوبی'}
```

### phone number
This module can validate and give you some data from a phone number.

```python
from persian_tools import phone_number

phone_number.validate('09123456789') # True
phone_number.validate('+989123456789') # True
phone_number.validate('989123456789') # True
phone_number.validate('98912345678') # False


phone_number.operator_data('09123456789')
# {'province': ['البرز', 'زنجان', 'سمنان', 'قزوین', 'قم', 'برخی از شهرستان های استان مرکزی'], 'base': 'تهران', 'type': ['permanent'], 'operator': 'همراه اول'}
phone_number.operator_data('09303456789')
# {'province': [], 'base': 'کشوری', 'type': ['permanent', 'credit'], 'operator': 'ایرانسل'}
```

0 comments on commit 857fe52

Please sign in to comment.