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]
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 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.2.tar.gz (53.9 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.2-cp39-abi3-musllinux_1_1_x86_64.whl (54.0 MB view details)

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

timezonefinder-8.2.2-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (54.0 MB view details)

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

File details

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

File metadata

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

File hashes

Hashes for timezonefinder-8.2.2.tar.gz
Algorithm Hash digest
SHA256 eb63bc7ac9975edfbd06e345a58f84d2b591bc18ff9060972cfefb813eea080b
MD5 dc1f4c696aa515a6cbbf7a9e72be5a81
BLAKE2b-256 22787959800dd3c8eb2ce4d39c082795f0397176b57b7db7500adc47990e8e31

See more details on using hashes here.

File details

Details for the file timezonefinder-8.2.2-cp39-abi3-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for timezonefinder-8.2.2-cp39-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 98c9cf6ff71e07629388533518ec5871d4764800c2bb6b9284981f9ac466c6f7
MD5 f8fd938d24f66574ec7c918959ee86dc
BLAKE2b-256 1e8f28a9efd809eb197abe3688b60e192318f2f25ac6bc6c0e53812100af078e

See more details on using hashes here.

File details

Details for the file timezonefinder-8.2.2-cp39-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.2-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1fe1c6dd2a6c3996472ae6917a7544d765bd74e84db2a9496942af55f60a0791
MD5 792cc18e031678971bfb46cfbb473acf
BLAKE2b-256 d530770a072831fe83f98b67b565176b9353dd6a7494268070117e040b2589a8

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