Package: leblad
Leblad pythe python version of leblad library, provide a list of Algerian administrative areas with many useful APIs
based ondzcode-io/lebladMetaCoverageGetting startedUsageInstallationpip install lebladAPIimportimportlebladapi=leblad.Api()getWilayaListReturns a list of algeria provinces or wilayasArgumentsreturn : Array of Wilaya Object attributes to keepExamplesallWilayasDetails=api.getWilayaList()getWilayaByZipCodeReturns a wilaya that includes the given zipCodeArgumentszip_codenumber (required) A zip code
return : Array of Wilaya Object attributes to keepExampleswilaya=api.getWilayaByZipCode(zip_code)getWilayaByCodeReturns a wilaya that includes the given wilaya code (mattricule).Argumentswilaya_codenumber (required) A zip code
return : Array of Wilaya Object attributes to keepExampleswilaya=api.getWilayaByCode(14)print(wilaya)# will print the wilaya object ({name: "Tiaret"...})getAdjacentWilayasTakes a wilaya code (matricule) and returns a list of adjacent wilayas codesArgumentswilaya_code(required) the Wilaya's "matricule"Examplesadjacent_wilayas=api.getAdjacentWilaya(31)print(adjacent_wilayas)# will print [46, 22, 29, 27]getZipCodesForWilayaTakes a wilaya code (matricule) and returns a list of Respective Zip-Codes for that wilayaArgumentswilaya_code(required) the Wilaya's "matricule"Exampleswilayas_zipcodes=api.getZipCodesForWilaya(31)print(wilayas_zipcodes)#returns list of zip codes for wilaya 31getWilayasByPhoneCodeTakes a phone code and returns the matching wilaya.Argumentsphone_code(required) the Wilaya's "phoneCode"Exampleswilaya=api.getWilayasByPhoneCode(34)print(wilaya)# will the wilaya object ({name: "Béjaïa"...})getWilayaByDairaNameTakes a daira name and returns the matching wilaya.ArgumentsdairaName: string(required) the Wilaya's "dairaName"Exampleswilaya=api.getWilayaByDairaName("OUED RHIOU")print(wilaya)#will print the wilaya object ({name: "Relizane"...})getBaladyiatsForDairaTakes a daira code and returns the matching baladyiats.Argumentsdaira_code: int(required) the Wilaya's "dairaName"Examplesbaladiyats=api.getBaladyiatsForDaira(1401)print(baladiyats)# will return baladyiats for daira of "Tiaret"getDairatsForWilayaTakes a wilaya code (matricule) ans returns list of all dairats of that wilaya.Argumentswilaya_code: number(required) the Wilaya's "matricule"Exampleswilaya_dairats=api.getDairatsForWilaya(3)print(wilaya_dairats)#returns list of dairats for wilaya 3getPhoneCodesForWilayaTakes a wilaya code (matricule) and returns a list of phone codes for given wilayaArgumentswilaya_code: number(required) the Wilaya's "matricule"Examplesphones=api.getPhoneCodesForWilaya(22)print(phones)#returns list of phone codes for wilaya 22getFirstPhoneCodeForWilayaTakes a wilaya code (matricule) and returns the first phone code from a list of phone codes for given wilayaArgumentswilayaCode: number(required) the Wilaya's "matricule"Examplesfirst_phonecode=api.getFirstPhoneCodeForWilaya(16)print(first_phonecode)#returns first phone code for wilaya 16getBaladyiatsForWilayaTakes a wilaya code (mattricule) and returns array of Baladiyates of wilaya.Argumentswilaya_code: number(required) the Wilaya's "matricule"Exampleswilaya_bladiyats=api.getBaladyiatsForWilaya(31)print(wilaya_bladiyats)# will print the baladyiats list ([{ code: 3125, name: 'AIN KERMA'..},{ code: 3105,name: 'ES SENIA',}])getWilayaByBaladyiaNameTakes a Baladyia name and returns wilaya in which baladyia is located.Argumentsbaladya: number(required) the Baladyia nameExampleswilaya=api.getWilayaByBaladyiaName('ES SENIA')print(wilaya)# will print the wilaya object ({name: "Oran"...})getDairaByBaladyiaNameTakes a Baladyia name and returns daira in which baladyia is located.Argumentsbaladyia_name: string(required) the Baladyia nameExamplesdaira=api.getDairaByBaladyiaName('ES SENIA')print(daira)#will print the daira object ({name: "ES SENIA"...})getFullAdjacentWilayaTakes a wilaya code  and returns a list of adjacent wilaya objectsArgumentswilaya_code: integer(required) the wilaya code (matricule)Examplesadjacent_wilaya_obj=api.getFullAdjacentWilaya('14')print(adjacent_wilaya_obj)#will print a list of objects of adjacent wilayagetAdjacentWilayaTakes a wilaya code  and returns a list of adjacent wilayasArgumentswilaya_code: integer(required) the wilaya code (matricule)Examplesadjacent_wilaya_obj=api.getAdjacentWilaya('14')print(adjacent_wilaya_obj)#will print a list of objects of adjacent wilayaTestingSimply runpython-munittesttests/test_index.pyLicenseCopyright (c) 2020 Licensed under the MIT license.