tzfpy
Probably the fastest Python package to convert longitude/latitude to timezone name
Decision gist · record as of 2026-08-14
Yes, if you need fast offline timezone lookup from coordinates. The package is actively maintained, has no known vulnerabilities, uses MIT license, and covers Python 3.10+ with pre-built wheels. Install with the tzdata extra for compatibility. The 111 m boundary accuracy and ~70 MB memory footprint are documented tradeoffs; verify they fit your constraints before adopting.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- First call triggers lazy initialization and may be noticeably slower than subsequent calls.
- Medium friction due to compiled Rust bindings, but pre-built wheels cover Python 3.10+ and common platforms.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution with minimal obligations—suitable for both open and closed projects.
last release 2026-08-10 (4 days) · last repo commit 2026-08-10 · 2 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,768,262 downloads/mo, #2,237 on PyPI
Alternatives
Verify before relying
pip install tzfpy
from tzfpy import get_tz
tz = get_tz(116.3883, 39.9289) # longitude, latitude
print(tz) # 'Asia/Shanghai'- Whether the 111 m boundary accuracy is sufficient for your use case (measured against 2026c dataset).
- Whether the ~70 MB memory footprint is acceptable in your deployment environment.
- Whether timezone names may differ from pytz or tzdata in edge cases when not using optional compatibility extras.
What it is and what it does
tzfpy is a Python binding to a Rust-based timezone lookup engine that maps geographic coordinates to IANA timezone names. It uses simplified polygon boundaries (Douglas-Peucker simplification with 0.001-degree epsilon) to keep memory usage around 70 MB while maintaining boundary accuracy within 111 m. The package is designed for speed: queries run in nanoseconds after the first lazy-initialized call, and it includes optional GeoJSON export for visualization and an index mode that trades 5 MB of additional memory for faster queries near timezone borders.
The package supports Python 3.10 and later with pre-built wheels for macOS (Intel and ARM), Linux (x86_64 and ARM64), and Windows. It can be installed with optional extras for compatibility with pytz or tzdata, and integrates with Python's standard zoneinfo module.
Use it for
- Batch-process GPS logs or location data to assign timezone names for time-aware analysis.
- Build location-based services that need to display local time without external API calls.
- Visualize timezone boundaries and coverage areas by exporting GeoJSON polygons.
- Embed timezone lookup in high-throughput applications where query latency matters.
- Validate or enrich geographic datasets with timezone information offline.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need fast offline timezone lookup from coordinates.
The package is actively maintained, has no known vulnerabilities, uses MIT license, and covers Python 3.10+ with pre-built wheels. Install with the tzdata extra for compatibility. The 111 m boundary accuracy and ~70 MB memory footprint are documented tradeoffs; verify they fit your constraints before adopting.
Install
tzfpy on PyPI
Before you install
Medium friction due to compiled Rust bindings, but pre-built wheels cover Python 3.10+ and common platforms. Active maintenance with release 4 days old.
Requires Python 3.10 or later. First call triggers lazy initialization and may be noticeably slower than subsequent calls.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal obligations—suitable for both open and closed projects.
Quickstart
pip install tzfpy
from tzfpy import get_tz
tz = get_tz(116.3883, 39.9289) # longitude, latitude
print(tz) # 'Asia/Shanghai'
Verify before relying
- Whether the 111 m boundary accuracy is sufficient for your use case (measured against 2026c dataset).
- Whether the ~70 MB memory footprint is acceptable in your deployment environment.
- Whether timezone names may differ from pytz or tzdata in edge cases when not using optional compatibility extras.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,768,262 / month, #2,237 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: RustTopic :: Scientific/Engineering :: GISTopic :: Software Development :: Libraries :: Python Modules |
Evidence: tzfpy-1.3.3-cp310-abi3-macosx_10_12_x86_64.whl; tzfpy-1.3.3-cp310-abi3-macosx_11_0_arm64.whl; tzfpy-1.3.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; tzfpy-1.3.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; tzfpy-1.3.3-cp310-abi3-musllinux_1_2_aarch64.whl; tzfpy-1.3.3-cp310-abi3-musllinux_1_2_x86_64.whl; tzfpy-1.3.3-cp310-abi3-win_amd64.whl; tzfpy-1.3.3-cp314-cp314t-macosx_10_12_x86_64.whl; tzfpy-1.3.3-cp314-cp314t-macosx_11_0_arm64.whl; tzfpy-1.3.3-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; tzfpy-1.3.3-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; tzfpy-1.3.3-cp314-cp314t-musllinux_1_2_aarch64.whl; tzfpy-1.3.3-cp314-cp314t-musllinux_1_2_x86_64.whl; tzfpy-1.3.3-cp314-cp314t-win_amd64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “geo coordinates timezone lookup”
- tzfpyConverts geographic coordinates (longitude/latitude) to timezone…
- timezonefinderLooks up the timezone for any WGS84 coordinate (latitude/longitude)…
- tzwhereLooks up the IANA timezone name for a given latitude and longitude…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also timezonefinder · tzwhere · pytzdata · tzlocal · pytz · django-timezone-field · pyzipcode · tzdata · suntime · pytz-deprecation-shim