Registry / serialization / datedelta

datedelta

JSON →
library1.4pypypi✓ verified 86d ago

Provides a DateDelta class for arithmetic between dates, similar to datetime.timedelta but for date objects. Current version 1.4, release cadence is low (last release 2019).

pip install datedelta
INSTALL
IMPORT
SIG · DATEDELTA
D
datedelta
serializationpythonv1.4
Install
1.5s avg
Import
—
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

datedelta
✓ from datedelta import datedelta
✗ from datedelta import DateDelta

Add a DateDelta to a date to get another date.

from datetime import date from datedelta import DateDelta, DAYS, MONTHS, YEARS today = date.today() delta = DateDelta(years=1, months=2, days=10) new_date = today + delta print(new_date) # Or using constants: new_date2 = today + 1*YEARS + 2*MONTHS + 10*DAYS print(new_date2)
Debug
Known issues
gotchaDateDelta cannot be added to datetime objects, only date objects. Attempting to add to datetime causes a TypeError.
fix
Convert datetime to date first: some_datetime.date() + datedelta
affects: all
gotchaAdding a DateDelta with months to a date near month end can produce unexpected results (e.g., Jan 31 + 1 month = Feb 28/29). No month overflow to next month.
fix
Be aware of month-end clamping behavior; it's by design.
affects: all
gotchaDateDelta only supports years, months, weeks, days. No support for hours, minutes, seconds, or microseconds.
fix
Use datetime.timedelta for sub-day precision.
affects: all
Upgrade
Version history
1.4latest on PyPI · released Jan 1, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
datedelta — pip install datedelta · libregistry