A Python package for querying US Zipcodes, and converting to coordinates and timezones
Project description
zipcode-coordinates-tz
A Python package that enables converting a US Zip Code into a timezone. This is done through the querying of the USPS API, then joining it with the zipcode-coordinates-tz data from the US Census, and finally taking the coordinates and using timezonefinder
to determine the timezone.
Dependencies:
- Geocoding Services Web Application Programming Interface (API)
- ZIP Codes by Area and District codes
- timezonefinder
Development
Setup Python Environment:
The first time run
uvx pre-commit install
If you need to relock:
Run scripts/lock.sh
Run code
Run scripts/console.sh uv run jupyter notebook
API Usage:
from zipcode_coordinates_tz import census, postal, timezone
df_postal_locales = await postal.get_locales()
df_postal_locales = df_postal_locales.loc[df_postal_locales.State == "NJ"]
df_postal_locales = await census.get_coordinates(df_postal_locales)
df_postal_locales = timezone.fill_timezones(df_postal_locales, fill_missing=True)
print(df_postal_locales)
As a CLI
python -m zipcode_coordinates_tz save NJ.json --state NJ --timezones --fill
Installation
To install zipcode-coordinates-tz from PyPI, use the following command:
$ pip install zipcode-coordinates-tz
You can also clone the repo and run the following command in the project root to install the source code as editable:
$ pip install -e .
Documentation
The documentation for zipcode-coordinates-tz
can be found here or in the project's docstrings.
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
Built Distribution
File details
Details for the file zipcode_coordinates_tz-0.4.0.tar.gz
.
File metadata
- Download URL: zipcode_coordinates_tz-0.4.0.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
ea09c7aaa57f74f8244259c157aa637c310fb8a7dad809ae61d125b4b58d565e
|
|
MD5 |
1a05dd97079af4def0602a4d0cd5b33e
|
|
BLAKE2b-256 |
ffcf52779d500b98830b6cded5d9b2f52313617732c70ee1c9d98ea34c31bc80
|
File details
Details for the file zipcode_coordinates_tz-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: zipcode_coordinates_tz-0.4.0-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
a5e7a09f0077437e70c05162cfdeeac95d84c8e7aefb6ac9570e220115afbddf
|
|
MD5 |
375a23c7bd7977c2d04075dfa0c5451e
|
|
BLAKE2b-256 |
bf546e594a68fcc8088042d31f6eb6ae5cef00aed0752e08d91a8fc40820320e
|