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.

Quick Guide

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

pip install timezonefinder[numba]
from timezonefinder import timezone_at

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


# 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/Paris'

Note: This library uses the "same since now dataset" optimized for the primary use case of timezone determination for current/future time calculations. For applications requiring historical accuracy or resolving to precise locations, consider parsing the original dataset (cf. Documentation).

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

References

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.

About

python package for finding the timezone of any point on earth (coordinates) offline

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 24