Skip to main content

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

Project description

https://github.com/jannikmi/timezonefinder/actions/workflows/build.yml/badge.svg?branch=master documentation status https://img.shields.io/pypi/wheel/timezonefinder.svg pre-commit total PyPI downloads latest version on PyPI latest version on conda-forge https://img.shields.io/badge/code%20style-black-000000.svg

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:

pip install timezonefinder[numba]
# 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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timezonefinder-8.2.3.tar.gz (54.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

timezonefinder-8.2.3-cp311-abi3-musllinux_1_1_x86_64.whl (54.3 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.1+ x86-64

timezonefinder-8.2.3-cp311-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (54.3 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

File details

Details for the file timezonefinder-8.2.3.tar.gz.

File metadata

  • Download URL: timezonefinder-8.2.3.tar.gz
  • Upload date:
  • Size: 54.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for timezonefinder-8.2.3.tar.gz
Algorithm Hash digest
SHA256 8084629ba5fe560df9d2a8d8f2c8e05c6b0d16e0e697e764c7e0704684bce4ac
MD5 cc1167f3fedf9b58f47e65e434f6f7f3
BLAKE2b-256 d5107d8d822e34a4cadaf2a70fef6a589c012a5d4e84862dc9d147cd0867dad5

See more details on using hashes here.

File details

Details for the file timezonefinder-8.2.3-cp311-abi3-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for timezonefinder-8.2.3-cp311-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 9439052511099921b1269f0bb5f3eed5f9dcee4c0af12884a0950591ef6ab00d
MD5 4cc0b1c1a83273ad1f7a7d0c4f5f2e6b
BLAKE2b-256 1f38736df12b6670ed0c641da0adb48cffb81ef4204a8f2e2a80d782651a2886

See more details on using hashes here.

File details

Details for the file timezonefinder-8.2.3-cp311-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for timezonefinder-8.2.3-cp311-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c0c9d213528a60eccf6d6abc49be532d1aab128f46859fcdf2e1124d5faefa6b
MD5 f994d3af6390a42ed39ab086921ac9ab
BLAKE2b-256 94e604fa37ccb26bda70d92ce27498787f9bacca01198fbebaf1363eea0257c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page