Skip to main content

zipcodes-in

zipcode

✍ Description of the project

Zipcodes-in is a Python library built for querying India zipcodes, post offices and particular state/UT. Py Package can be installed from here.

📊 Data description and preparation

  • Data was extracted from here
  • Cleaned the data and extracted all the values for India (IN). Script can be found here
  • Finally, the data was converted from CSV to JSON. The data can be found here

📍 Functionalities

  • Query if a zipcode matches or not
  • List random zipcodes
  • Validate of a zipcode exists or not
  • List top N zipcodes
  • List any random N zipcodes
  • List all the zipcodes in the dataset (absolutely NOT recommended!)

💻 Installation

# Install the package 
>>> pip install zipcodes-in

Zipcodes-in supports Python 3.6+

👩‍💻 Running Scripts

>>> from zipcode_script import zipcode
>>> print(zipcode)
Zipcode class to validate and fetch data of provided India zipcode

>>> # Zipcode matching
>>> print(zipcode.matching('834001'))
[{'zipcode': '834001', 
'region': 'Ranchi', 
'state_ut': 'Jharkhand', 
'country': 'India', 
'latitude': '23.3505', 
'longitude': '85.2927', 
'post_office': 'Argora.'}]

# Print random zipcodes 
>>> print(zipcode.random())
{'zipcode': '177601', 
'region': 'Hamirpur(HP)', 
'state_ut': 'Himachal Pradesh', 
'country': 'India', 
'latitude': '31.7124', 
'longitude': '76.4841', 
'post_office': 'Badhani'}

>>> # Print N random zipcodes 
>>> print(zipcode.listRandomN(3))
[{'zipcode': '711410', 
'region': 'Howrah', 
'state_ut': 'West Bengal', 
'country': 'India', 
'latitude': '22.526', 
'longitude': '88.0676', 
'post_office': 'Paikpara'}, 
{'zipcode': '585107', 
'region': 'Kalaburagi', 
'state_ut': 'Karnataka', 
'country': 'India', 
'latitude': '17.2967', 
'longitude': '76.6671', 
'post_office': 'Kalaburagi HCB'}, 
{'zipcode': '688539', 
'region': 'Alappuzha', 
'state_ut': 'Kerala', 
'country': 'India', 
'latitude': '9.7869', 
'longitude': '76.3235', 
'post_office': 'Varanad'}]

>>> # Print top N zipcodes
>>> print(zipcode.listTopN(2))
[{'zipcode': '110001', 
'region': 'New Delhi', 
'state_ut': 'Delhi', 
'country': 'India', 
'latitude': '28.6369', 
'longitude': '77.2183', 
'post_office': 'New Delhi G.P.O.'}, 
{'zipcode': '110002', 
'region': 'New Delhi', 
'state_ut': 'Delhi', 
'country': 'India', 
'latitude': '28.6453', 
'longitude': '77.2456', 
'post_office': 'Civic Centre'}]

NOTE: Version 1.0 is tested on Windows10. 
## If you face any issue while running, please raise an issue on this repository

⚠️ The zipcode data was last updated on: Jul. 27th, 2021 ⚠️

Looking forward to make the project better? 🤔

We are open to suggestions and ideas! Feel free to raise an issue and we shall get back to you super soon!

📑 LICENSE

MIT LICENSE

Metadata

Release files for zipcodes-in 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zipcodes-in 0.2.0
File Size Uploaded Provenance Actions
zipcodes-in-0.2.0.tar.gz 328.9 kB Without provenance Details for zipcodes-in-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zipcodes-in 0.2.0
File Interpreter ABI Platform Actions
zipcodes_in-0.2.0-py3-none-any.whl Python 3 none any Details for zipcodes_in-0.2.0-py3-none-any.whl

Total release size: 685.8 kB

Release files / zipcodes-in-0.2.0.tar.gz

Download URL zipcodes-in-0.2.0.tar.gz
Size 328.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4767b1dde5210bea4c14807c77d68393dd0bfc80c74827eb2bd4af1a295601db
BLAKE2b-256 checksum
How to use checksums
9645b5d8fbb661033a920e2df04734fcbd346406830028062319a4b0946192f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.3

Release files / zipcodes_in-0.2.0-py3-none-any.whl

Download URL zipcodes_in-0.2.0-py3-none-any.whl
Size 356.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1754f06a84c74dd28ff835ed4b59ec3ecbf6871522ee95952b5ba614b426f5ab
BLAKE2b-256 checksum
How to use checksums
87e01c8027a103455c52d903ae4dcba441f50e2969ff448102415b4c9db408a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.3

Security for zipcodes-in 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page