pytz

World timezone definitions for Python, powered by the IANA (Olson) tz database.

Library
PyPI
v2026.4
397 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
76 /100 Good
Development Activity 84
Maintenance 64
Community 76
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
78 /100 Good
Architecture 82
Code Quality 78
Innovation 72
Learning Curve 80

pytz brings the IANA (formerly Olson) time zone database into Python, giving applications accurate, cross-platform timezone calculations that stay correct across daylight-saving transitions and historical offset changes. It exposes every zone in the tz database as a ready-to-use tzinfo object, along with helpers for localizing naive datetimes, normalizing arithmetic results, and enumerating common or country-specific zones.

For well over a decade pytz was the de-facto timezone layer for the Python ecosystem, underpinning Django, pandas, and countless web and data applications. Its data is regenerated several times a year to track upstream IANA releases, so deployments get up-to-date rules without waiting on the host operating system.

What You Get

  • The full IANA/Olson tz database bundled as Python tzinfo objects, refreshed several times a year
  • timezone() lookup plus localize() and normalize() helpers for DST-correct datetime handling
  • Curated lists such as common_timezones, all_timezones, and country_timezones for building pickers and validators

Common Use Cases

  • Storing and converting timestamps across regions in web and API backends
  • Rendering event times in a user’s local zone while keeping UTC as the canonical store
  • Validating and populating timezone selection fields from a maintained zone list

Under The Hood

Architecture - pytz separates generated data from runtime logic: the top-level repo generates code via gen_tzinfo.py from the upstream IANA tarballs, while the shipped package in src/pytz exposes a thin API surface (init.py) over compiled zone definitions. timezone() resolves a zone name to a tzinfo built by tzfile.build_tzinfo() from binary zoneinfo resources, and LazyDict/LazyList in lazy.py defer loading of the large zone lists until first access to keep import cheap.

Tech Stack - The distributable is pure Python (setup.py, packaging pytz plus its zoneinfo data files) targeting everything from Python 2.4 through 3.13, with zero runtime dependencies. The surrounding repository uses C, Makefiles, and awk to regenerate the tz database from IANA sources, but none of that toolchain is required by consumers who only install the Python package.

Code Quality - The library carries a dedicated tests directory (test_tzinfo.py, test_lazy.py, test_docs.py) plus doctests embedded throughout init.py, and defines a clear exception hierarchy (AmbiguousTimeError, NonExistentTimeError, UnknownTimeZoneError) for edge cases. The code is conservative and heavily commented, retaining Python 2/3 compatibility shims that reflect its long maintenance history rather than modern idioms.

API Design - The public API is small and well documented: pytz.timezone(name) returns a tzinfo, and the localize()/normalize() pattern is the established idiom for DST-correct handling. The main ergonomic caveat is that datetime’s own tzinfo constructor argument must not be used with pytz zones — you must call localize() instead — a well-known footgun documented prominently in the README.

Used by 30 apps in this directory

Python
100%
Apache 2.0

Agno

AI Development · Automation · Devops

42,358

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
66
Dependency
Built with
Python 100%
Updated 4 days ago
Python
47%
Other

Airbyte

Data Engineering · Developer Tools

22,143

Open-source ELT platform with 600+ connectors for moving data from any source to warehouses, lakes, and AI agents.

View details
95
Repo Health
80
Technical
67
Dependency
Built with
Python 47%
Kotlin 43%
Updated 4 days ago
Python
89%
Apache 2.0

Apache Airflow

Data Engineering

46,995

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
64
Dependency
Built with
Python 89%
Updated 4 days ago
Python
59%
Apache 2.0

argilla

AI Development · Data Engineering

5,125

Collaborate on high-quality AI training data with a self-hosted annotation platform built for LLMs, NLP, and multimodal models.

View details
65
Repo Health
81
Technical
61
Dependency
Built with
Python 59%
Jupyter Notebook 21%
Updated 1 weeks ago
Python
97%
MIT

auto-news

AI Assistants · Productivity

908

An AI-powered personal news aggregator that filters multi-source feeds through LLMs and delivers curated, noise-free summaries to your Notion workspace.

View details
43
Repo Health
53
Technical
66
Dependency
Built with
Python 97%
Updated 1 years ago
Python
79%
Apache 2.0

changedetection.io

Monitoring

34,605

Self-hosted website change detection with AI-powered smart alerts, browser automation, price tracking, and 85+ notification channels.

View details
91
Repo Health
80
Technical
68
Dependency
Built with
Python 79%
Updated 1 weeks ago
C++
68%
Apache 2.0

ClickHouse

Analytics · Data Engineering · Databases

50,116

Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.

View details
95
Repo Health
90
Technical
64
Dependency
Built with
C++ 68%
Python 14%
Updated 4 days ago
HTML
85%
Apache 2.0

Elementary

Analytics · Data Engineering · Monitoring

2,414

The dbt-native data observability CLI that turns your existing dbt tests and metadata into anomaly detection, lineage graphs, and Slack/Teams alerts — no separate platform required.

View details
81
Repo Health
75
Technical
79
Dependency
Built with
HTML 85%
Python 15%
Updated 5 days ago
TypeScript
97%
Other

GrowthBook

Ab Testing Experimentation · Analytics · Developer Tools

8,446

Open source feature flags, A/B testing, and warehouse-native experimentation that queries your existing data infrastructure—no data movement required.

View details
92
Repo Health
85
Technical
63
Dependency
Built with
TypeScript 97%
Updated 4 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers