Skip to main content

A simple timezone lookup by zip code

Project description

zip2tz

A simple Python library to look up timezones by US zip code.

Installation

pip install zip2tz

Or with uv:

uv add zip2tz

Usage

import zip2tz

# Get timezone for a zip code
tz = zip2tz.timezone("90210")
print(tz)  # America/Los_Angeles

# Returns None if zip code not found
tz = zip2tz.timezone("00000")
print(tz)  # None

API

timezone(zipcode: str) -> str | None

Returns the IANA timezone string (e.g., "America/New_York") for the given zip code, or None if the zip code is not found.

Development

This project uses uv for dependency management.

# Clone the repo
git clone https://github.com/yourusername/zip2tz.git
cd zip2tz

# Build
uv build

# Run tests
uv venv .venv-test
uv pip install dist/zip2tz-*.whl -p .venv-test
.venv-test/Scripts/python tests/smoke_test.py  # Windows
# .venv-test/bin/python tests/smoke_test.py    # Linux/Mac

License

MIT License - see LICENSE for details.

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

zip2tz-0.1.0.tar.gz (102.4 kB view details)

Uploaded Source

Built Distribution

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

zip2tz-0.1.0-py3-none-any.whl (101.5 kB view details)

Uploaded Python 3

File details

Details for the file zip2tz-0.1.0.tar.gz.

File metadata

  • Download URL: zip2tz-0.1.0.tar.gz
  • Upload date:
  • Size: 102.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","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 zip2tz-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6c66bdd338e56347e88aaa5293046b05e7c8fec3b04e3267d740e1475a4cdb97
MD5 d6d49df88634320e3af3603444aecdf2
BLAKE2b-256 11e9aa8e8fd26d3991f82f7b29867944dfd659bb7b6d54aa60f423f092ee4f8b

See more details on using hashes here.

File details

Details for the file zip2tz-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zip2tz-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 101.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","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 zip2tz-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d37be96809330b5197fe2d78b76a69fb9c1d64d9bbee124f640d07432b16573
MD5 a1ab0f457212fe39464dbaed1ce01f52
BLAKE2b-256 d6b01f92cf7649fb45d8c1b58270fa996e2bda89a6c40166238d1ba50d077e71

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