--- id: datedelta version: "1.4" license: BSD-3-Clause license_treatment: permissive maintenance: aging --- # datedelta — Like datetime.timedelta, for date arithmetic. License: permissive · Maintenance: aging · Downloads: 145.3K/mo ## What it is and what it does datedelta is a small library that adds calendar-aware date arithmetic to Python's standard datetime module. Where datetime.timedelta works with fixed day counts, datedelta lets you add or subtract years, months, weeks, and days from dates while respecting the Gregorian calendar's quirks—leap years and variable month lengths. When arithmetic would land on a non-existent date (like February 30th), it rolls forward to the first day of the next month, ensuring consistent and predictable results. The library is designed for subscription billing, recurring events, and any scenario where you need to add a human-readable period ("3 months", "1 year") to a date and get a sensible result. It provides both simple constants (YEAR, MONTH, WEEK, DAY) for common operations and a flexible datedelta class for arbitrary combinations. The package has no external dependencies and supports Python 3.6 through 3.10. Use it for: - Calculate subscription renewal dates that account for leap years and month-end edge cases - Add or subtract calendar months/years from dates without losing precision to day-of-month mismatches - Generate recurring event schedules that respect calendar boundaries (e.g., monthly billing on the 31st) - Handle date arithmetic in financial or legal contexts where calendar precision matters - Compute date ranges for reports or periods that span variable-length months or leap years ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. datedelta extends Python's datetime module with calendar-aware date arithmetic for years, months, weeks, and days, handling leap years and variable month lengths correctly. Yes. This is a stable, production-ready library (Development Status 5) with no security vulnerabilities, zero dependencies, and low install friction. It solves a real problem that datetime.timedelta cannot—calendar-aware arithmetic—and is well-suited for billing, scheduling, and any date math that must respect human calendar conventions. The aging maintenance status is not a blocker for a focused, mature library with no active vulnerabilities. ## Install pip install datedelta uv add datedelta poetry add datedelta ## Installing datedelta Before you install: Low install friction with no runtime dependencies. Last release was in 2022 and the repository shows activity as of 2026-01-05, though the package is classified as aging with 1686 days since the last release. License in practice: BSD-3-Clause is a permissive license allowing commercial and private use with minimal restrictions, making this safe for most projects. Quickstart: import datetime import datedelta # Add 3 months to a date result = datetime.date(2025, 4, 22) + 3 * datedelta.MONTH print(result) # datetime.date(2025, 7, 22) # Subtract a year from a leap day result = datetime.date(2024, 2, 29) - datedelta.YEAR print(result) # datetime.date(2023, 3, 1) Verify before relying: - Whether the package receives active maintenance or is in maintenance-only mode despite recent repository commits - Performance characteristics when used with large date ranges or in tight loops ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 145.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags date arithmetic library, calendar-aware timedelta, add months to date, gregorian calendar math, subscription period calculation, leap year date handling, month and year arithmetic, date-arithmetic, calendar-math [View on SkillFed](https://skillfed.io/packages/datedelta) · [View on PyPI](https://pypi.org/project/datedelta/)