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.5.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zipcode_coordinates_tz-0.5.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zipcode_coordinates_tz-0.5.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for zipcode_coordinates_tz-0.5.0.tar.gz
Algorithm Hash digest
SHA256 9b9b69552b00dafec87513718b5efbb9206be2420991256ddd4ae066402fe34d
MD5 15e1c856ff8964faf6be841407a7d1d6
BLAKE2b-256 b3ffc4bca5f8b43b18e955634a3396e4a11712168a73a29cc491f2fd43c36eaa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zipcode_coordinates_tz-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for zipcode_coordinates_tz-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86cda91a38da9a68af6c661850ee793dd2801e092f2177a4165c9259b63306e0
MD5 0345ef711f34ffd3b99e18208d8e7116
BLAKE2b-256 2d69d8f02e2874e4d6ed3ecc94dc3ce75f76e4a76b29be083812d1837682df65

See more details on using hashes here.

Supported by

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