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.4.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.4-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.4-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (54.3 MB view details)

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

timezonefinder-8.2.4-cp311-abi3-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_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.4.tar.gz.

File metadata

  • Download URL: timezonefinder-8.2.4.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.4.tar.gz
Algorithm Hash digest
SHA256 d80fae37adf1497729cc3e69826c22f3b2fec16db07932bf389b6ae545400b42
MD5 d38ddfae547c1b6bdd20368006856c51
BLAKE2b-256 67f277f407fac773a72e18e91657896fdec9b61ed4e31b35adf7270d8f5f71b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for timezonefinder-8.2.4-cp311-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 54f3a8cae6715bf2f6a4c1a31189dc709d2fbabc5671147d5cb461455d6c6f39
MD5 0a4a357b0c8430a1c5f66f012001e912
BLAKE2b-256 c58a4fc4538471cc34ca5aab758d0e372afedb93428170c18da1e5706a9e1119

See more details on using hashes here.

File details

Details for the file timezonefinder-8.2.4-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for timezonefinder-8.2.4-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 97e9336391be6e10ca85f2ccdd36491c2aa2611e5265561de0f2e3b1652c2a68
MD5 db90ac02eae48c0f849db4252e02af54
BLAKE2b-256 b0e49b5c948bc657420fa7d0a86acc1489f977e4d459b088a957c0e046b2897f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for timezonefinder-8.2.4-cp311-abi3-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 c824271053f0e3ad0700a2c504d609317c8c288655d8e48e1f382d0da094e94c
MD5 657bf8e10a6b5ac05b23b13a32ca7bdf
BLAKE2b-256 7f7b422744a1ac2a5a2bec21f0d17f927a5324ed3e0c442c64337d265a266a0f

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