https://github.com/jannikmi/timezonefinder
python package for finding the timezone of any point on earth (coordinates) offline
https://github.com/jannikmi/timezonefinder
coordinates geolocation latitude location longitude python timezone timezone-library timezone-picker timezones
Last synced: 15 days ago
JSON representation
python package for finding the timezone of any point on earth (coordinates) offline
- Host: GitHub
- URL: https://github.com/jannikmi/timezonefinder
- Owner: jannikmi
- License: mit
- Created: 2016-02-25T00:50:33.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-12-05T09:14:02.000Z (6 months ago)
- Last Synced: 2025-12-08T18:11:43.439Z (6 months ago)
- Topics: coordinates, geolocation, latitude, location, longitude, python, timezone, timezone-library, timezone-picker, timezones
- Language: Python
- Homepage: https://timezonefinder.michelfe.it/
- Size: 297 MB
- Stars: 522
- Watchers: 9
- Forks: 67
- Open Issues: 17
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Agents: Agents.md
Awesome Lists containing this project
README
==============
timezonefinder
==============
..
Note: can't include the badges file from the docs here, as it won't render on PyPI -> sync manually
.. image:: https://github.com/jannikmi/timezonefinder/actions/workflows/build.yml/badge.svg?branch=master
:target: https://github.com/jannikmi/timezonefinder/actions?query=branch%3Amaster
.. image:: https://readthedocs.org/projects/timezonefinder/badge/?version=latest
:alt: documentation status
:target: https://timezonefinder.readthedocs.io/en/latest/?badge=latest
.. image:: https://img.shields.io/pypi/wheel/timezonefinder.svg
:target: https://pypi.python.org/pypi/timezonefinder
.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
:target: https://github.com/pre-commit/pre-commit
:alt: pre-commit
.. image:: https://pepy.tech/badge/timezonefinder
:alt: total PyPI downloads
:target: https://pepy.tech/project/timezonefinder
.. image:: https://img.shields.io/pypi/v/timezonefinder.svg
:alt: latest version on PyPI
:target: https://pypi.python.org/pypi/timezonefinder
.. image:: https://img.shields.io/conda/vn/conda-forge/timezonefinder.svg
:target: https://anaconda.org/conda-forge/timezonefinder
:alt: latest version on conda-forge
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
This is a python package providing offline timezone lookups for WGS84 coordinates.
In comparison to other alternatives this package aims at maximum accuracy around timezone borders (no geometry simplifications) while offering fast lookup performance and compatibility with many (Python) runtime environments.
It combines preprocessed polygon data, H3-based spatial shortcuts, and optional acceleration via Numba or a clang-backed point-in-polygon routine.
Notice: Looking for maintainers. Reach out if you want to contribute!
---------------------------------------------------------------------
Quick Guide
-----------
It is recommended to install it together with the optional `Numba `__ package for increased performance:
.. code-block:: console
pip install timezonefinder[numba]
.. code-block:: python
# use the global function for convenience:
from timezonefinder import timezone_at
tz = timezone_at(lng=13.358, lat=52.5061) # 'Europe/Paris'
# For improved performance and control, create and reuse an instance:
from timezonefinder import TimezoneFinder
tf = TimezoneFinder(in_memory=True) # reuse
query_points = [(13.358, 52.5061), ...]
for lng, lat in query_points:
tz = tf.timezone_at(lng=lng, lat=lat) # 'Europe/Paris'
**Note:** This library uses the full original timezone dataset with all >440 timezone names, providing full localization capabilities and historical timezone accuracy. For applications that prefer a smaller memory footprint, the reduced "timezones-now" dataset is available via the ``parse_data.sh`` script (cf. `Documentation `__).
**Alternative:** Need maximum speed at the cost of accuracy? Check out `tzfpy `__ - a fast and lightweight alternative based on Rust.
References
----------
* `Documentation `__
* `PyPI `__
* `conda-forge feedstock `__
* `download stats `__
* `online GUI and API `__
* `GUI repository `__
* `ruby port `__
LICENSE
-------
``timezonefinder`` is licensed under the `MIT license `__.
The data is licensed under the `ODbL license `__, following the base dataset from `evansiroky/timezone-boundary-builder `__.