Skip to main content
documentation status https://img.shields.io/pypi/wheel/ziptimezone.svg total PyPI downloads latest version on PyPI https://img.shields.io/badge/code%20style-black-000000.svg

This is a python package with US Zip Code convenience functions such as those listed in the examples below. It uses the geonames data, coupled with the timezonefinder package. It uses a mapping of the popular timezone regions in US, and returns the outputs accordingly. Latest release includes dependency fixes and documentation updates.

Quick Guide:

pip install ziptimezone
import ziptimezone as zpt

# returns a tuple (42.377, -71.1256)
zpt.get_lat_long_for_zip('02138')

# returns 'Eastern' the timezone has been reduced to the more popular zones
# for United States Regions
zpt.get_timezone_by_zip('02138')

# returns a dictionary, {'02138': 'Eastern', '85260': 'Mountain'}
zpt.get_timezone_for_many_zips(['02138', '85260'])

# returns a string, '02138 is ahead of 72201 by 1.00 hours."}
zpt.calculate_time_difference_between_zips(['02138', '72201'])

# returns a dictionary, for 5/30/24 {'sunrise_time': '05:11:13', 'sunset_time': '20:13:31'}
today_sun_times = get_sunrise_sunset_for_zip("02138")

# Get sunrise and sunset times for ZIP code 02138 on July 4, 2024
# will return {'sunrise_time': '05:13:42', 'sunset_time': '20:24:10'}
july4_sun_times = get_sunrise_sunset_for_zip("02138", datetime(2024, 7, 4).date())

For more refer to the Documentation.

Also check:

PyPI

Metadata

Release files for ziptimezone 1.1.8

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

Source distribution (sdist)

Source distribution for ziptimezone 1.1.8
File Size Uploaded
ziptimezone-1.1.8.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ziptimezone 1.1.8
File Interpreter ABI Platform
ziptimezone-1.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 17.8 kB

Release files / ziptimezone-1.1.8.tar.gz

Download URL ziptimezone-1.1.8.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
68d880e40f1b50d696ff5fff215653b267a588582e0891d1a63b867ad6ccbecf
BLAKE2b-256 checksum
How to use checksums
f8333f6b098254450ad54d1d5d36b33c932ca65a46293d54c118beb5599b1012
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.9 Windows/10

Release files / ziptimezone-1.1.8-py3-none-any.whl

Download URL ziptimezone-1.1.8-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d736502362998e4ac8ef77edbe87a64049a3ad705734b91839c155dd73681bc
BLAKE2b-256 checksum
How to use checksums
bb85de1441cebbd238ccc14034db5b7efd766176b578ea138343f78924eaa30a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.9 Windows/10

Release history Release notifications | RSS feed

This release

1.1.8 This release

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.10.9

2 release files

0.10.8

2 release files

0.10.7

2 release files

0.10.6

2 release files

0.10.5

2 release files

0.10.4

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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