Skip to content

jannikmi/timezonefinder

Repository files navigation

timezonefinder

https://github.com/jannikmi/timezonefinder/actions/workflows/build.yml/badge.svg?branch=master documentation status pre-commit total PyPI downloads latest version on PyPI latest version on conda-forge

Notice: Looking for maintainers. Reach out if you want to contribute!

This is a python package for looking up the corresponding timezone for given coordinates on earth entirely offline.

It is recommended to install it together with the optional Numba package for increased performance:

Quick Guide:

pip install timezonefinder[numba]
from timezonefinder import timezone_at

tz = timezone_at(lng=13.358, lat=52.5061)  # 'Europe/Berlin'


# For thread safety, increased performance and control, re-use 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/Berlin'

Need maximum speed at the cost of accuracy? Check out tzfpy - a fast alternative based on Rust.

For more refer to the Documentation.

Also check:

PyPI

online GUI and API

conda-forge feedstock

ruby port: timezone_finder

download stats

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.