pytz

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

Library
PyPI
v2026.5
396 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
68 /100 Good
Development Activity 64
Maintenance 52
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
52%
Other

Odoo

CRM · ERP · Productivity

55,289

The open source ERP platform that integrates CRM, accounting, inventory, manufacturing, and 60+ business apps into one seamlessly connected suite.

View details
87
Repo Health
82
Technical
64
Dependency
Built with
Python 52%
JavaScript 43%
Updated 6 days ago
Python
38%
Other

Open WebUI

AI Agents · AI Assistants

156,607

The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.

View details
92
Repo Health
75
Technical
66
Dependency
Built with
Python 38%
Svelte 35%
JavaScript 19%
Updated 6 days ago
TypeScript
50%
Other

Phase Console

Devops · Security

931

End-to-end encrypted secrets management for engineering teams — from local dev to Kubernetes production.

View details
85
Repo Health
73
Technical
63
Dependency
Built with
TypeScript 50%
Python 48%
Updated 1 weeks ago
Rust
63%
MIT

PostgresML

AI Development · Databases

6,823

Run ML training and LLM inference natively inside PostgreSQL with GPU acceleration — no data movement required.

View details
51
Repo Health
76
Technical
64
Dependency
Built with
Rust 63%
JavaScript 11%
Updated 1 years ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

40,397

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 6 days ago
Python
99%
Apache 2.0

Rasa Open Source

AI Assistants · AI Development · Voice AI

21,353

Rasa Open Source is a Python machine learning framework for building contextual, multi-turn chatbots and voice assistants that understand natural language and maintain conversation state.

View details
62
Repo Health
78
Technical
63
Dependency
Built with
Python 99%
Updated 3 months ago
Python
45%
Other

Redash

Analytics · Data Engineering

28,849

Redash lets anyone connect to 35+ SQL and NoSQL data sources, write a query in the browser, and turn the result into a shared dashboard — no separate BI suite required.

View details
91
Repo Health
74
Technical
61
Dependency
Built with
Python 45%
JavaScript 29%
TypeScript 19%
Updated 1 weeks ago
Python
59%
AGPL 3.0

Speakr

AI Assistants

4,112

Self-hosted AI transcription with speaker diarization, smart tagging, and multi-user collaboration — your recordings stay on your infrastructure.

View details
84
Repo Health
79
Technical
70
Dependency
Built with
Python 59%
HTML 21%
JavaScript 17%
Updated 1 weeks ago
Python
94%
Apache 2.0

SWIRL

Data Engineering · Databases · Search

3,046

Federated AI search and RAG across 100+ enterprise sources—no data extraction, no vector database required.

View details
61
Repo Health
83
Technical
65
Dependency
Built with
Python 94%
Updated 1 weeks 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