Registry / monthdelta

monthdelta

JSON →
library0.9.1pypypi✓ verified 80d ago

A Python library for date computations involving months, providing MonthDelta and MonthDate classes. Current version 0.9.1, last released in 2013. No active maintenance; may have compatibility issues with newer Python versions.

pip install monthdelta
INSTALL
IMPORT
SIG · MONTHDELTA
M
monthdelta
pythonv0.9.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

monthdelta
from monthdelta import monthdelta
from monthdelta import MonthDelta
monthmod
from monthdelta import monthmod
date
from monthdelta import date

Basic usage of MonthDelta and MonthDate for month-based date arithmetic.

from monthdelta import MonthDelta, MonthDate from datetime import date, datetime # Add one month to a date start = date(2020, 1, 31) result = start + MonthDelta(1) print(result) # 2020-02-29 (end-of-month aware) # Difference in months between dates d1 = date(2020, 1, 15) d2 = date(2020, 3, 15) md = MonthDelta(d2 - d1) # warning: may be inaccurate for uneven months print(md.months) # 2 # Use MonthDate for month components dt = MonthDate(2020, 2, 29) print(dt) # 2020-02-29
Debug
Known issues
gotchaMonthDelta behaves differently for dates with different number of days. Adding 1 month to Jan 31 gives Feb 28/29, not March 3. This may cause confusion if you expect strict 30-day increments.
fix
Understand that MonthDelta respects month boundaries, not day offsets. Use dateutil.relativedelta for more predictable behavior.
affects: all
deprecatedThe library has not been updated since 2013. It may not work with Python 3.9+ due to removal of some deprecated datetime methods.
fix
Consider using dateutil.relativedelta as a drop-in replacement.
affects: >=3.9
Upgrade
Version history
0.9.1latest on PyPI · released Apr 23, 2009
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
monthdelta — pip install monthdelta · libregistry