# python-pendulum/pendulum

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/python-pendulum-pendulum).**

6,668 stars · 429 forks · Python · MIT

## Links

- GitHub: https://github.com/python-pendulum/pendulum
- Homepage: https://pendulum.eustace.io
- awesome-repositories: https://awesome-repositories.com/repository/python-pendulum-pendulum.md

## Description

Pendulum is a Python datetime library used for creating, manipulating, and formatting date and time objects with native timezone awareness. It extends the native Python datetime class to maintain compatibility while providing a specialized engine for date arithmetic and timezone management.

The library features a dedicated ISO 8601 and RFC 3339 parser that converts standardized strings into date objects without requiring manual format strings. It also includes a relative time generator for producing natural language descriptions of time differences and a timezone management tool that automatically handles daylight savings transitions.

Additional capabilities cover temporal data arithmetic, such as measuring complex intervals and iterating through date ranges. The library provides tools for localized date rendering, calendar boundary snapping, and system time mocking to simulate time travel for software testing.

## Tags

### Data & Databases

- [Date and Time Libraries](https://awesome-repositories.com/f/data-databases/date-and-time-libraries.md) — Implements a comprehensive suite for creating, manipulating, and formatting date and time objects with timezone awareness. ([source](https://pendulum.eustace.io/docs/))
- [Daylight Savings Normalizations](https://awesome-repositories.com/f/data-databases/date-and-time-libraries/daylight-savings-normalizations.md) — Automatically handles daylight savings transitions and normalizes dates across DST boundaries. ([source](https://pendulum.eustace.io/docs/2.x/))
- [String-to-Datetime Parsing](https://awesome-repositories.com/f/data-databases/string-to-datetime-parsing.md) — Features a dedicated parser that converts ISO 8601 and RFC 3339 strings into timezone-aware objects.
- [Chronological Comparisons](https://awesome-repositories.com/f/data-databases/date-and-time-libraries/chronological-comparisons.md) — Determines if one date occurs before, after, or at the same time as another using comparison operators. ([source](https://pendulum.eustace.io/docs/))
- [Date Component Extractors](https://awesome-repositories.com/f/data-databases/date-and-time-libraries/date-component-extractors.md) — Retrieves specific time components such as day of year or UTC offset as integers or floats. ([source](https://pendulum.eustace.io/docs/2.x/))
- [Date Component Modifiers](https://awesome-repositories.com/f/data-databases/date-and-time-libraries/date-component-modifiers.md) — Creates new date instances by updating specific components like year or month without mutating the original object. ([source](https://pendulum.eustace.io/docs/))
- [Standard Format Recognizers](https://awesome-repositories.com/f/data-databases/date-and-time-libraries/standard-format-recognizers.md) — Outputs dates in predefined industry formats including Atom, Cookie, RSS, and various RFC specifications. ([source](https://pendulum.eustace.io/docs/2.x/))

### Development Tools & Productivity

- [Date Arithmetic Logic](https://awesome-repositories.com/f/development-tools-productivity/date-and-time-utilities/component-based-date-time-specifications/date-period-arithmetic/date-arithmetic-logic.md) — Provides computational tools for adding or subtracting specific durations of time from date instances. ([source](https://pendulum.eustace.io/docs/))
- [Arithmetic Engines](https://awesome-repositories.com/f/development-tools-productivity/date-and-time-utilities/component-based-date-time-specifications/date-period-arithmetic/date-arithmetic-logic/arithmetic-engines.md) — Ships a specialized engine for date arithmetic, including adding durations and iterating through ranges.
- [Date String Parsers](https://awesome-repositories.com/f/development-tools-productivity/date-and-time-utilities/relative-date-formatting/date-string-parsers.md) — Provides specialized utilities for automatically converting ISO 8601 and RFC 3339 strings into native date objects. ([source](https://pendulum.eustace.io/docs/))
- [Temporal Arithmetic](https://awesome-repositories.com/f/development-tools-productivity/date-and-time-utilities/temporal-arithmetic.md) — Performs precise additions and subtractions of time units and calculates complex intervals between dates.
- [Date Formatting Utilities](https://awesome-repositories.com/f/development-tools-productivity/date-formatting-utilities.md) — Converts date objects into human-readable strings using standard ISO formats or custom token systems. ([source](https://pendulum.eustace.io/docs/))
- [DateTime Libraries](https://awesome-repositories.com/f/development-tools-productivity/datetime-libraries.md) — Provides a comprehensive Python library for timezone-aware date and time manipulation.
- [Date Difference Calculators](https://awesome-repositories.com/f/development-tools-productivity/duration-formatters/duration-interval-calculators/date-difference-calculators.md) — Computes the duration between two date instances and expresses the result in units like hours or days. ([source](https://pendulum.eustace.io/docs/))
- [Relative Time Humanization](https://awesome-repositories.com/f/development-tools-productivity/localization-support/string-localization/relative-time-humanization.md) — Produces natural language descriptions of time differences, such as '2 hours ago' or '1 month from now'. ([source](https://pendulum.eustace.io/docs/))
- [Date Sequence Generators](https://awesome-repositories.com/f/development-tools-productivity/date-and-time-utilities/calendar-date-calculations/date-sequence-generators.md) — Generates programmatic sequences of dates between two points using fixed intervals for time-series analysis. ([source](https://pendulum.eustace.io/docs/2.x/))
- [Temporal Boundary Normalization](https://awesome-repositories.com/f/development-tools-productivity/date-and-time-utilities/component-based-date-time-specifications/temporal-boundary-normalization.md) — Snaps a date to the start or end of a specific calendar period, such as the beginning of a week or month. ([source](https://pendulum.eustace.io/docs/))
- [Date String Formatters](https://awesome-repositories.com/f/development-tools-productivity/date-formatting-utilities/date-string-formatters.md) — Renders dates into human-readable strings using specific language locales for names and phrases. ([source](https://pendulum.eustace.io/docs/))
- [Date Difference Phrases](https://awesome-repositories.com/f/development-tools-productivity/date-formatting-utilities/human-readable-formatters/date-difference-phrases.md) — Produces natural language descriptions of time differences, such as '2 hours ago', with locale support.

### Scientific & Mathematical Computing

- [Temporal Interval Measurements](https://awesome-repositories.com/f/scientific-mathematical-computing/temporal-interval-measurements.md) — The library measures the distance between two points in time using complex units like years and months. ([source](https://pendulum.eustace.io/))

### Software Engineering & Architecture

- [ISO 8601 Parsers](https://awesome-repositories.com/f/software-engineering-architecture/data-exchange-standards/iso-8601-standards/iso-8601-parsers.md) — Includes specialized parsers for converting ISO 8601 and RFC 3339 standardized strings into programmable objects.
- [Timezone Management](https://awesome-repositories.com/f/software-engineering-architecture/timezone-management.md) — Provides advanced logic for managing geographic timezones and handling wall-clock shifts across different regions.
- [Immutable Data Patterns](https://awesome-repositories.com/f/software-engineering-architecture/immutable-data-patterns.md) — Implements an immutable object pattern for date instances to prevent unintended side effects during arithmetic.
- [Date-Time Format Strings](https://awesome-repositories.com/f/software-engineering-architecture/object-schema-definitions/value-objects/monetary/display-formatting/date-time-format-strings.md) — Uses a mapping of custom tokens and locale-specific strings to translate date attributes into human-readable text.

### Content Management & Publishing

- [Temporal](https://awesome-repositories.com/f/content-management-publishing/q-a-content-strategies/range-generators/sequence-generators/temporal.md) — Produces a series of timestamps by iteratively adding fixed durations between two boundary points.

### Testing & Quality Assurance

- [System Clock Mocks](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/dependency-mocking/timer-mocks/database-timestamp-mocks/system-clock-mocks.md) — Intercepts system clock calls to return predefined timestamps for consistent results during automated testing.
- [Virtual Time Testing](https://awesome-repositories.com/f/testing-quality-assurance/virtual-time-testing.md) — Provides utilities to decouple the application from the system clock for deterministic time-sensitive testing.

### User Interface & Experience

- [Relative Time Formatting](https://awesome-repositories.com/f/user-interface-experience/relative-time-formatting.md) — The library converts time differences into human-readable strings or localized words for improved user presentation. ([source](https://cdn.jsdelivr.net/gh/python-pendulum/pendulum@main/README.md))

### Web Development

- [System Clock Mocking](https://awesome-repositories.com/f/web-development/history-management/undo-redo-history/time-travel-debuggings/system-clock-mocking.md) — The library manipulates the perceived current time by shifting to absolute or relative points in the future or past. ([source](https://pendulum.eustace.io/docs/))

### Part of an Awesome List

- [Date And Time](https://awesome-repositories.com/f/awesome-lists/devtools/date-and-time.md) — Simplified datetime handling and arithmetic.
