Skip to main content

A Python package for querying US Zipcodes, and converting to coordinates and timezones

Project description

zipcode-coordinates-tz

CI Build License PyPI Version versions

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:

Development

Setup Python Environment:

Run scripts/console.sh

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

zipcode_coordinates_tz-0.4.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

zipcode_coordinates_tz-0.4.0-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file zipcode_coordinates_tz-0.4.0.tar.gz.

File metadata

File hashes

Hashes for zipcode_coordinates_tz-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ea09c7aaa57f74f8244259c157aa637c310fb8a7dad809ae61d125b4b58d565e
MD5 1a05dd97079af4def0602a4d0cd5b33e
BLAKE2b-256 ffcf52779d500b98830b6cded5d9b2f52313617732c70ee1c9d98ea34c31bc80

See more details on using hashes here.

File details

Details for the file zipcode_coordinates_tz-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for zipcode_coordinates_tz-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5e7a09f0077437e70c05162cfdeeac95d84c8e7aefb6ac9570e220115afbddf
MD5 375a23c7bd7977c2d04075dfa0c5451e
BLAKE2b-256 bf546e594a68fcc8088042d31f6eb6ae5cef00aed0752e08d91a8fc40820320e

See more details on using hashes here.

Supported by

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