python-dateutil

Powerful extensions to Python's datetime module for parsing, deltas, recurrence, and timezones.

Library
PyPI
v3.0.0
2,641 stars
Apache-2.0 OR BSD-3-Clause

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
88 /100 Excellent
Development Activity 100
Maintenance 72
Community 80
Maturity 60
Momentum 40

Technical Analysis

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

python-dateutil is the de facto standard library for anything Python’s built-in datetime module doesn’t handle out of the box. It adds fuzzy natural-language date parsing, calendar-correct relative date arithmetic, RFC 2445 (iCalendar) recurrence rules, and comprehensive timezone resolution against system and Olson tz data. First released in 2003 and now downloaded hundreds of millions of times a week, it underpins countless higher-level libraries (including pandas) that need robust date and time handling.

The package is organized into small, independently importable submodules — parser, relativedelta, rrule, tz, easter, and utils — so consumers pay only for what they use. A strict test suite (including Hypothesis-based property tests and warnings-as-errors CI) and years of careful deprecation handling have made it one of the most trusted low-level building blocks in the Python ecosystem.

What You Get

  • parser.parse() for fuzzy, locale-tolerant parsing of almost any date/time string format into a native datetime
  • relativedelta for calendar-correct arithmetic (e.g. adding a month without manual day-overflow handling)
  • rrule implementing the full iCalendar (RFC 2445) recurrence-rule specification, including recurrence sets and string parsing
  • tz module with tzfile, tzoffset, tzlocal, gettz(), and Windows registry-based timezone support backed by Olson tz data
  • easter() for computing Easter Sunday under Western, Orthodox, or Julian algorithms
  • isoparser for strict, fast ISO-8601 parsing when input format is known and controlled

Common Use Cases

  • Parsing user-submitted or scraped date strings of unknown format into usable datetime objects
  • Computing recurring schedules (billing cycles, reminders, recurring events) via rrule
  • Calendar-aware date math such as “three months from today” or “the last weekday of this month”
  • Resolving and converting between timezones reliably across Linux, macOS, and Windows
  • Backing higher-level data and scheduling libraries that need dependable date/time primitives

Under The Hood

Architecture: dateutil is organized into clearly separated submodules under src/dateutil/ — parser/ (_parser.py holds the core tokenizer and parse() entry point, isoparser.py handles strict ISO-8601 parsing), tz/ (tz.py implements tzfile, tzoffset, tzlocal, tzwin, and gettz() resolution against system/Olson zoneinfo data, backed by _common.py’s shared ambiguity helpers), rrule.py (a single ~1700-line module implementing the iCalendar RFC 2445 recurrence engine), relativedelta.py (the relativedelta/weekday classes for calendar-aware arithmetic), and easter.py/utils.py for narrow utilities. Each submodule is lazily importable via a custom __getattr__ in __init__.py, so consumers pay import cost only for the piece they use.

Tech Stack: A pure-Python package targeting Python 2.7 and 3.3+, with a single runtime dependency on six for Py2/3 compatibility shims — evidence of its long legacy tail. Build tooling is classic setuptools plus setuptools_scm for version derivation from git tags, packaged from a src/ layout. CI spans GitHub Actions and AppVeyor for Windows coverage, with codecov tracking and pre-commit hooks for lint.

Code Quality: Testing is thorough — tests/ mirrors the module layout with dedicated suites for the parser, rrule, tz, relativedelta, easter, and isoparser modules, plus a property/ subdirectory using Hypothesis for property-based testing of parsing and recurrence edge cases. pytest is configured with filterwarnings = error, so any uncaught DeprecationWarning fails the suite — a strict signal of deliberate API stewardship. Deprecated private functions (_timelex, _tzparser, _resultbase) are explicitly wrapped to emit warnings rather than silently removed.

API Design: The public surface is small and memorable — parse(), relativedelta(), rrule(), and tz.gettz() — each usable independently with minimal boilerplate. The tradeoff is a slightly dated surface: parser.parse() accepts loosely-typed kwargs (dayfirst, yearfirst, fuzzy) rather than a structured config object, and the six dependency signals years of Python 2 compatibility baggage. Documentation is comprehensive — a full Sphinx site on Read the Docs plus docs/examples.rst and a dedicated exercises directory — keeping the learning curve shallow despite the API’s age.

Used by 50 apps in this directory

Python
39%
Apache 2.0

OpenSandbox

Developer Tools · Security

16,116

Secure, fast, and extensible sandbox runtime for AI agents with multi-language SDKs and Docker/Kubernetes runtimes.

View details
85
Repo Health
81
Technical
70
Dependency
Built with
Python 39%
Go 36%
Updated 6 days ago
Python
63%
GPL 3.0

Paperless-ngx

Bookmarks Archiving

47,038

Turn your paper pile into a searchable digital archive with OCR, AI classification, and automated workflows — all running on your own server.

View details
91
Repo Health
88
Technical
67
Dependency
Built with
Python 63%
TypeScript 28%
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
Python
49%
Other

Arize Phoenix

Analytics · Devops · Monitoring

11,976

Open-source AI observability platform for tracing, evaluating, and debugging LLM applications with built-in intelligence and MCP support.

View details
92
Repo Health
88
Technical
67
Dependency
Built with
Python 49%
TypeScript 43%
Updated 6 days ago
Python
62%
Apache 2.0

Polar

Developer Tools · Ecommerce · Invoicing Finance

10,410

Open source payments infrastructure that turns software into a business — subscriptions, usage-based billing, digital products, and merchant-of-record compliance in one platform.

View details
90
Repo Health
82
Technical
66
Dependency
Built with
Python 62%
TypeScript 31%
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
TypeScript
98%
MIT

Promptfoo

AI Development

26,358

An open-source CLI and library for evaluating and red-teaming LLM applications — replace trial-and-error prompt engineering with systematic evals, vulnerability scanning, and CI/CD integration.

View details
90
Repo Health
73
Technical
67
Dependency
Built with
TypeScript 98%
Updated 6 days ago
JavaScript
50%
AGPL 3.0

QRev

AI Agents · CRM

364

Open source AI-first sales platform that replaces Salesforce with autonomous agents handling prospecting, outreach, and lead management at scale.

View details
39
Repo Health
68
Technical
64
Dependency
Built with
JavaScript 50%
Python 28%
TypeScript 14%
Updated 8 months 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