--- id: tzfpy version: "1.3.3" license: MIT license_treatment: permissive maintenance: active --- # tzfpy — Probably the fastest Python package to convert longitude/latitude to timezone name License: permissive · Maintenance: active · Downloads: 4.8M/mo ## 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 above — verify before relying. Converts geographic coordinates (longitude/latitude) to timezone names using simplified polygon data, with optional GeoJSON export for visualization. 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 pip install tzfpy uv add tzfpy poetry add tzfpy ## Installing tzfpy 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. 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' Requires Python 3.10 or later. First call triggers lazy initialization and may be noticeably slower than subsequent calls. 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_current - Install friction: medium - Maintenance: active - Downloads: 4.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags longitude latitude to timezone, geo coordinates timezone lookup, timezone from GPS coordinates, fast timezone geolocation, timezone polygon data, coordinate to timezone conversion, geolocation, timezone-lookup, rust-binding [View on SkillFed](https://skillfed.io/packages/tzfpy) · [View on PyPI](https://pypi.org/project/tzfpy/)