Skip to content

Commit

Permalink
Merge pull request #5 from abderrahmaneMustapha/testing
Browse files Browse the repository at this point in the history
Testing
  • Loading branch information
abderrahmaneMustapha authored Jan 8, 2021
2 parents 6670eb7 + 7bb4e84 commit 4662aa1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
leblad.egg-info
dist
__pycache__
build
build
a.py
47 changes: 23 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Takes a wilaya code (matricule) and returns a list of adjacent wilayas codes
**Examples**

```python
adjacent_wilayas = api.getAdjacentWilayas(31)
adjacent_wilayas = api.getAdjacentWilaya(31)
print(adjacent_wilayas) # will print [46, 22, 29, 27]
```

Expand All @@ -93,11 +93,11 @@ Takes a wilaya code (matricule) and returns a list of Respective Zip-Codes for t
**Examples**

```python
wilayas_zipcodes = api.getAdjacentWilayas(31)
wilayas_zipcodes = api.getZipCodesForWilaya(31)
print(wilayas_zipcodes) #returns list of zip codes for wilaya 31
```

#### getWilayaByPhoneCode
#### getWilayasByPhoneCode

Takes a phone code and returns the matching wilaya.

Expand All @@ -108,7 +108,7 @@ Takes a phone code and returns the matching wilaya.
**Examples**

```python
wilaya = api.getWilayaByPhoneCode(34));
wilaya = api.getWilayasByPhoneCode(34)
print(wilaya) # will the wilaya object ({name: "Béjaïa"...})
```

Expand All @@ -129,16 +129,16 @@ print(wilaya) #will print the wilaya object ({name: "Relizane"...})

#### getBaladyiatsForDaira

Takes a daira name and returns the matching baladyiats.
Takes a daira code and returns the matching baladyiats.

**Arguments**

- `daira: string` (**required**) the Wilaya's "dairaName"
- `daira_code: int` (**required**) the Wilaya's "dairaName"

**Examples**

```python
baladiyats = api.getBaladyiatsForDaira("Tiaret"));
baladiyats = api.getBaladyiatsForDaira(1401)
print(baladiyats) # will return baladyiats for daira of "Tiaret"
```

Expand All @@ -157,21 +157,6 @@ wilaya_dairats = api.getDairatsForWilaya(3)
print(wilaya_dairats) #returns list of dairats for wilaya 3
```

### getBaladyiatsForDaira

Takes a daira name and returns the matching baladyiats.

**Arguments**

- `daira: string` (**required**) the Wilaya's "dairaName" in en|fr|ar

**Examples**

```python
baladyiats = api.getBaladyiatsForDaira("Adrar")
print(baladyiats) # will return baladyiats for daira of "Adrar"
```

#### getPhoneCodesForWilaya

Takes a wilaya code (matricule) and returns a list of phone codes for given wilaya
Expand Down Expand Up @@ -213,8 +198,8 @@ Takes a wilaya code (mattricule) and returns array of Baladiyates of wilaya.
**Examples**

```python
wilaya_bladiyats = api.getBaladyiatsForWilaya(31));
print(wilaya_baladiyats) # will print the baladyiats list ([{ code: 3125, name: 'AIN KERMA'..},{ code: 3105,name: 'ES SENIA',}])
wilaya_bladiyats = api.getBaladyiatsForWilaya(31)
print(wilaya_bladiyats) # will print the baladyiats list ([{ code: 3125, name: 'AIN KERMA'..},{ code: 3105,name: 'ES SENIA',}])
```

### getWilayaByBaladyiaName
Expand Down Expand Up @@ -261,6 +246,20 @@ Takes a wilaya code and returns a list of adjacent wilaya objects
adjacent_wilaya_obj =api.getFullAdjacentWilaya('14')
print(adjacent_wilaya_obj) #will print a list of objects of adjacent wilaya
```
### getAdjacentWilaya

Takes a wilaya code and returns a list of adjacent wilayas

**Arguments**

- `wilaya_code: integer` (**required**) the wilaya code (matricule)

**Examples**

```python
adjacent_wilaya_obj =api.getAdjacentWilaya('14')
print(adjacent_wilaya_obj) #will print a list of objects of adjacent wilaya
```
## Testing

Simply run
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="leblad", # Replace with your own username
version="0.0.1",
version="0.0.2",
author="Toumi abderrahmane",
author_email="abderrahmanemustapha030898@gmail.com",
description="the python version of leblad library, provide a list of Algerian administrative areas with many useful APIs"
Expand Down

0 comments on commit 4662aa1

Please sign in to comment.