Pendulum
Python datetime library that makes working with dates, times, and timezones easy and correct. Pendulum provides a drop-in replacement for Python's datetime with immutable objects, DST-aware timezone handling, natural language period parsing, and human-readable duration strings (2 hours ago, in 3 days). Addresses the many pitfalls of the standard datetime module.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Local library with no network access. Timezone data bundled. No security concerns.
⚡ Reliability
Best When
Your Python agent needs reliable timezone-aware datetime handling, human-readable durations, or parsing diverse date formats without DST bugs.
Avoid When
You only need basic datetime operations without timezone complexity — standard datetime or dateutil is simpler.
Use Cases
- • Parse and manipulate dates in agent pipelines with correct timezone handling and DST transitions
- • Generate human-readable relative time strings ('3 hours ago', 'in 2 days') for agent output and notifications
- • Perform date arithmetic in agent scheduling logic (add 2 business days, find next Monday, etc.)
- • Parse diverse date string formats from external APIs reliably without manual strptime format strings
- • Handle timezone-aware scheduling in multi-timezone agent workflows with correct DST transitions
Not For
- • Simple datetime operations — Python's standard datetime is sufficient if you don't need timezone complexity
- • High-frequency datetime parsing in tight loops — arrow or dateutil may be faster for simple use cases
- • Environments where dependency size matters — pendulum includes timezone data
Interface
Authentication
Local Python library — no authentication.
Pricing
Completely free and open source.
Agent Metadata
Known Gotchas
- ⚠ Pendulum 3.x (Rust-powered) has some breaking API changes from 2.x — check migration guide when upgrading
- ⚠ pendulum.now() uses the local system timezone by default — always pass timezone explicitly for deterministic agent behavior
- ⚠ Period and Duration are different types — Period is between two datetimes (calendar-aware), Duration is absolute; mixing them causes unexpected results
- ⚠ pendulum.parse() is permissive by default — ambiguous strings like '01/02/03' will be parsed without error but may be wrong date
- ⚠ Pendulum's diff() returns Period objects, not timedelta — code that expects timedelta.days will break; use .in_days() or .total_seconds() methods
- ⚠ Serialization to JSON requires converting to ISO string or timestamp — pendulum.DateTime is not directly JSON serializable; use .isoformat() or .int_timestamp
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Pendulum.
Scores are editorial opinions as of 2026-03-06.