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:
ruby port: timezone_finder
timezonefinder
is licensed under the MIT license.
The data is licensed under the ODbL license, following the base dataset from evansiroky/timezone-boundary-builder.