Skip to main content

Easy access to Serbia zip codes. You can search zip code by city, or city by zip code

Project description

Serbia zip codes

Easy access to Serbia zip codes. You can search zip code by city, or city by zip code.

Installation

pip install serbia-zip-codes

Usage

import serbia_zip_codes

Search city by city:

>>> result = serbia_zip_codes.find_by_city("Loznica")
>>> print(result)
[{'city': 'Loznica', 'zip_code': '15300'}]
>>> print(result[0]['zip_code'])
15300

Search city by zip code:

>>> result = serbia_zip_codes.find_by_zip("15300")
>>> print(result)
[{'city': 'Loznica', 'zip_code': '15300'}]
>>> print(result[0]['city'])
Loznica

Multiple results example:

>>> from pprint import pprint
>>> import serbia_zip_codes
>>> result = serbia_zip_codes.find_by_city("beograd")
>>> pprint(result)
[{'city': 'Beograd', 'zip_code': '11000'},
 {'city': 'Beograd Voždovac', 'zip_code': '11010'},
 {'city': 'Beograd Čukarica', 'zip_code': '11030'},
 {'city': 'Beograd Zvezdara', 'zip_code': '11050'},
 {'city': 'Beograd Palilula', 'zip_code': '11060'},
 {'city': 'Beograd Zemun', 'zip_code': '11080'},
 {'city': 'Beograd Rakovica', 'zip_code': '11090'}]

Get all:

>>> result = serbia_zip_codes.get_all()
>>> pprint(result)
[{'city': 'Beograd', 'zip_code': '11000'},
 {'city': 'Beograd Voždovac', 'zip_code': '11010'},
 {'city': 'Beograd Čukarica', 'zip_code': '11030'},
 {'city': 'Beograd Zvezdara', 'zip_code': '11050'},
 {'city': 'Beograd Palilula', 'zip_code': '11060'},
 {'city': 'Novi Beograd', 'zip_code': '11070'},
 {'city': 'Beograd Zemun', 'zip_code': '11080'},
 {'city': 'Beograd Rakovica', 'zip_code': '11090'},
 {'city': 'Kaluđerica', 'zip_code': '11130'},
 {'city': 'Rušanj', 'zip_code': '11194'},
 {'city': 'Borča', 'zip_code': '11211'},
 {'city': 'Ovča', 'zip_code': '11212'},
 {'city': 'Padinska Skela', 'zip_code': '11213'},
 {'city': 'Beli Potok', 'zip_code': '11223'},
 {'city': 'Vrčin', 'zip_code': '11224'},
 {'city': 'Zuce', 'zip_code': '11225'},
 {'city': 'Pinosava', 'zip_code': '11226'},
 {'city': 'Ripanj', 'zip_code': '11232'},
 {'city': 'Ralja', 'zip_code': '11233'},
 {'city': 'Mali Požarevac', 'zip_code': '11235'},
 {'city': 'Ostružnica', 'zip_code': '11251'},
 {'city': 'Sremčica', 'zip_code': '11253'},
 {'city': 'Umka', 'zip_code': '11260'},
 {'city': 'Mala Moštanica', 'zip_code': '11261'},
 {'city': 'Velika Mostanica', 'zip_code': '11262'},
 {'city': 'Surčin', 'zip_code': '11271'},
 {'city': 'Dobanovci', 'zip_code': '11272'},
...

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

serbia_zip_codes-1.0.0.tar.gz (16.5 kB view hashes)

Uploaded Source

Built Distribution

serbia_zip_codes-1.0.0-py3-none-any.whl (13.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page