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.5.tar.gz (55.0 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.5-cp311-abi3-musllinux_1_1_x86_64.whl (55.0 MB view details)

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

timezonefinder-8.2.5-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (55.0 MB view details)

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

timezonefinder-8.2.5-cp311-abi3-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl (55.0 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.5.tar.gz.

File metadata

  • Download URL: timezonefinder-8.2.5.tar.gz
  • Upload date:
  • Size: 55.0 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.5.tar.gz
Algorithm Hash digest
SHA256 cca1aebf11c8034f0fe4c442fc068232dc2f355038cf61ffa67653caf90ae3e9
MD5 9aac81fc0c12ccb3403e0b16292a1e36
BLAKE2b-256 a76d54439b6e76289c9d2527c8243e7e4ca5f4c1c1700a7e8a21ad27c6618822

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for timezonefinder-8.2.5-cp311-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 b588e86dbe9a4487f43ce114b8ff0c488a84755a09db4fc67d3f04dacbcfdd77
MD5 23aeb6ce2ca9e90fb82d85792ba27306
BLAKE2b-256 44b0a74a357c5aa24d593611ad704e2a43222aa6212d0290954d644464fc42d4

See more details on using hashes here.

File details

Details for the file timezonefinder-8.2.5-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.5-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 976230555eb9943f3651fa00fe587854a5c1b6d0aa9c7c714296d0934dccf406
MD5 0a48930f6627769c5f7436d7104efc2a
BLAKE2b-256 d6d7f165f143a46ab6e8951f8cb543b341a51e6ba71d67309dea8b865a331ad2

See more details on using hashes here.

File details

Details for the file timezonefinder-8.2.5-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.5-cp311-abi3-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 447fd33a39d3ae60a0b7ca2e2b9b3538b941e434a3673300659aa79996a0ae9c
MD5 e607eda33069603ca883ad23b8d3da59
BLAKE2b-256 70d705e8022491e1b9f4b81041383bcc1b70d764dbf6c8c6bfd81f012ff1dae2

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