{"id":27155,"library":"monthdelta","title":"monthdelta","description":"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.","status":"active","version":"0.9.1","language":"python","source_language":"en","source_url":"https://github.com/... (PyPI page: https://pypi.org/project/monthdelta/)","tags":["month","date","calendar","delta","arithmetic"],"install":[{"cmd":"pip install monthdelta","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"The correct class is MonthDelta, not monthdelta.","wrong":"from monthdelta import monthdelta","symbol":"MonthDelta","correct":"from monthdelta import MonthDelta"},{"note":"","wrong":"","symbol":"MonthDate","correct":"from monthdelta import MonthDate"}],"quickstart":{"code":"from monthdelta import MonthDelta, MonthDate\nfrom datetime import date, datetime\n\n# Add one month to a date\nstart = date(2020, 1, 31)\nresult = start + MonthDelta(1)\nprint(result)  # 2020-02-29 (end-of-month aware)\n\n# Difference in months between dates\nd1 = date(2020, 1, 15)\nd2 = date(2020, 3, 15)\nmd = MonthDelta(d2 - d1)  # warning: may be inaccurate for uneven months\nprint(md.months)  # 2\n\n# Use MonthDate for month components\ndt = MonthDate(2020, 2, 29)\nprint(dt)  # 2020-02-29","lang":"python","description":"Basic usage of MonthDelta and MonthDate for month-based date arithmetic."},"warnings":[{"fix":"Understand that MonthDelta respects month boundaries, not day offsets. Use dateutil.relativedelta for more predictable behavior.","message":"MonthDelta 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using dateutil.relativedelta as a drop-in replacement.","message":"The library has not been updated since 2013. It may not work with Python 3.9+ due to removal of some deprecated datetime methods.","severity":"deprecated","affected_versions":">=3.9"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install monthdelta","cause":"monthdelta is not installed or Python environment issue.","error":"ImportError: No module named monthdelta"},{"fix":"Ensure you import datetime module before monthdelta, or use from datetime import date, timedelta explicitly.","cause":"Incorrect import of monthdelta's internal timedelta? Unlikely; this error may occur if user tries to use monthdelta while shadowing datetime.","error":"AttributeError: module 'datetime' has no attribute 'timedelta'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}