
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
.. Note: can't include the badges file from the docs here, as it won't render on PyPI -> sync manually
.. image:: https://readthedocs.org/projects/ziptimezone/badge/?version=latest :alt: documentation status :target: https://ziptimezone.readthedocs.io/en/latest/?badge=latest
.. image:: https://img.shields.io/pypi/wheel/ziptimezone.svg :target: https://pypi.python.org/pypi/ziptimezone
.. image:: https://pepy.tech/badge/ziptimezone :alt: total PyPI downloads :target: https://pepy.tech/project/ziptimezone
.. image:: https://img.shields.io/pypi/v/ziptimezone.svg :alt: latest version on PyPI :target: https://pypi.python.org/pypi/ziptimezone
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black
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:
.. code-block:: console
pip install ziptimezone
.. code-block:: python
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 <https://ziptimezone.readthedocs.io/en/latest/>
__.
Also check:
PyPI <https://pypi.python.org/pypi/ziptimezone/>
__
FAQs
A package to convert ZIP codes to time zones and get geographic coordinates.
We found that ziptimezone demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.