skillfed

tzwhere

Python library to look up timezone from lat / long offline

tzwhere v3.0.3 686.4K downloads/30d#5,348 on PyPI147
Permissive license MIT License DORMANT released

What it is and what it does

pytzwhere is an offline timezone lookup library that takes a latitude and longitude and returns the IANA timezone name for that location. It uses polygon data derived from VMAP0 and work by Eric Muller to map geographic coordinates to timezones without requiring a network call. The library handles most points accurately, but acknowledges that some locations fall outside VMAP0 polygon boundaries; it offers a fallback mode to search for the closest timezone within a user-defined radius for edge cases.

The package is a Python port of an earlier JavaScript implementation. It has no declared runtime dependencies in the package metadata, though the description mentions shapely as a dependency and numpy as optional. The main trade-off is install friction: the package ships with embedded timezone polygon data that must be loaded into memory on first use, making it suitable for applications that need reliable offline timezone resolution but not for extremely lightweight deployments.

Use it for:

  • Resolve timezone for GPS coordinates in mobile or IoT applications without network access.
  • Batch-process location data to assign timezones for logging, scheduling, or reporting.
  • Build location-aware features in web services where timezone must be inferred from user coordinates.
  • Handle timezone assignment in offline-first or disconnected applications.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Looks up the IANA timezone name for a given latitude and longitude entirely offline, using polygon data based on VMAP0.

Yes, if you need offline timezone lookup and can tolerate the install friction and dormant maintenance status. The package is stable and has no known vulnerabilities, but it has not been updated since 2017-08-24 and the repository shows no recent activity. It remains in the top tier of PyPI packages, suggesting it works reliably for its narrow use case. Consider it a solved problem for coordinate-to-timezone mapping, but verify that the embedded polygon data meets your accuracy requirements and that you can accept the large initial memory footprint.

Install

tzwhere on PyPI

pip

pip install tzwhere

uv

uv add tzwhere

poetry

poetry add tzwhere

Installing tzwhere

Before you install

High install friction: the package ships as a source tarball and carries a large embedded timezone polygon dataset. No runtime dependencies are declared, though the description notes shapely as a dependency and numpy as optional. Last release was 2017-08-24; the repository is not archived but has been dormant for over 3277 days.

License in practice

MIT License (permissive): you may use, modify, and distribute this package freely in commercial and private projects, provided you retain the license notice.

Quickstart

from tzwhere import tzwhere
tz = tzwhere.tzwhere()
print(tz.tzNameAt(35.29, -89.66))

The package requires shapely and embeds large timezone polygon data; initial instantiation loads this data into memory.

Verify before relying

  • Whether shapely is truly a required runtime dependency or only optional, as the description lists it under 'Dependencies' without clarifying its status.
  • Current compatibility with modern Python versions and whether Python 2 support is still functional.
  • Whether the embedded VMAP0 polygon data has been updated since the last release in 2017.
  • Actual download volume and user base, as popularity metrics may not reflect current active usage.

Package facts

License MIT License (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance dormant — 3,277 days since the last release
Last repo commit
First released
Downloads 686,408/month — #5,348 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: tzwhere-3.0.3.tar.gz

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Software Development :: Localization

Tags

timezone lookup from coordinateslat lng to timezone offlinegeolocation timezonetimezone from latitude longitudeoffline timezone databasecoordinate to timezone mapping
geolocationoffline-firsttimezone-data

More Localization packages