mikud: Search for Israeli zip code numbers#
βοΈ mikud is a Python3 library to search israelβs zip codes (mikud) by their addresses.
π For a complete documentation of available functions, see the Reference.
>>οΈ This tool based on israelpost website - Click here.
π Installation#
Install using pip3:
pip3 install -U mikud
Install from source:
git clone https://github.com/david-lev/mikud.git
cd mikud && python3 setup.py install
π Features#
Search zip code by address
Search address by zip code
Get cities
Get streets
π¨βπ» Usage#
from mikud import Mikud
mikud = Mikud()
mikud_res = mikud.search_mikud(city_name="ΧΧ¨ΧΧ©ΧΧΧ",
street_name="ΧΧ Χ€Χ Χ Χ©Χ¨ΧΧ",
house_number="20")
print(mikud_res.zip)
#> 9546432
addr = mikud.search_address(zip_code=9546432)
print(addr.city_name, addr.street_name, addr.house_number)
#> ΧΧ¨ΧΧ©ΧΧΧ ΧΧ Χ€Χ Χ Χ©Χ¨ΧΧ 20
πΎ Requirements#
Python 3.6 or higher - https://www.python.org
π Setup and Usage#
See the Documentation for detailed instructions
β Disclaimer#
This application is intended for educational purposes only. Any use in professional manner or to harm anyone or any organization doesnβt relate to me and can be considered as illegal.
π Reference#
- Mikud.search_mikud(city_name: str = '', city_id: Union[str, int] = '', street_name: str = '', street_id: Union[str, int] = '', house_number: Union[str, int] = '', pob: Union[str, int] = '', entry: str = '') Address#
- Get zip code (mikud) of address.
You can specify the name of the city and street (or their id from
search_cities()andsearch_streets()) and the house number.Alternatively, you can specify just the
city_name(orcity_id) and thepob(Post office box) to get the zip code.
- Parameters
city_name (str) β City name. Default - empty. Optional if
pobprovided.city_id (Union[int, str]) β City ID. Default - empty. Optional if
city_nameprovided.street_name (str) β Street name. Default - empty. Optional if
pobprovided.street_id (Union[int, str]) β Street ID. Default - empty. Optional if
street_nameorpobprovided.house_number (Union[int, str]) β House number. Default - empty. Optional if pob provided.
pob (Union[int, str]) β Post office box. Default - empty. Optional if
city_name,street_nameandhouse_numberprovided.entry (str) β Entry. for example -
Χ,Χ. Default - empty. Optional ifpobprovided.
- Returns
Object
Address()- Return type
- Mikud.get_cities(city_name: str) List[City]#
Search cities by name to use in
search_mikud()and insearch_streets().
- Mikud.get_streets(city_name: str, street_name: str, city_id: Union[int, str] = '') List[Street]#
Search street by name to use in
search_mikud().
- class mikud.Address(zip: Optional[int] = None, city: Optional[str] = None, cityname: Optional[str] = None, cityid: Optional[int] = None, cityID: Optional[int] = None, street: Optional[str] = None, streetid: Optional[int] = None, streetID: Optional[int] = None, housenumber: Optional[int] = None, pob: Optional[int] = None, messageResult: Optional[str] = None)#
- This class represent a Address object.
The following parameters are the attributes of this object.
Ignore the names of the parameters in the class structure ^, they are there to deal with the json parsing.
- Parameters
zip (Union[int, None]) β Zip code of 7 numbers.
city_name (Union[str, None]) β The name of the city.
city_id (Union[int, None]) β The id of the city.
street_name (Union[str, None]) β The name of the street.
street_id (Union[int, None]) β The id of the street.
house_number (Union[int, None]) β The number of the house.
pob (Union[int, None]) β The number of the post office box.
results (Union[str, None]) β The message from the api.
- class mikud.City(id: Optional[int] = None, n: Optional[str] = None, zip: Optional[int] = None)#
- This class represent a city object.
The following parameters are the attributes of this object.
Ignore the names of the parameters in the class structure ^, they are there to deal with the json parsing.