Install & Compatibility
Where this runs
tested against v0.6.12 · 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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.030s · 21.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.8s · import 0.026s · 22MB
20MB installed
● package 20MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
dateutils
✓ import dateutils
✗ from dateutils.api import DateUtils
This quickstart demonstrates how to use the `DateUtils` API to calculate the difference between two dates and generate a range of dates, showcasing common functionalities provided by this wrapper library.
from datetime import datetime, date
from dateutils.api import DateUtils
# Calculate the difference between two dates
date1 = date(2023, 1, 1)
date2 = date(2023, 1, 15)
diff_days = DateUtils.diff(date1, date2).days
print(f"Difference in days: {diff_days}")
# Generate a date range
start_date = date(2023, 3, 1)
end_date = date(2023, 3, 5)
dates_in_range = list(DateUtils.range(start_date, end_date))
print(f"Dates in range: {dates_in_range}")
Debug
Known issues
gotchaPotential confusion with `python-dateutil`: This library, `dateutils` (without the hyphen in the package name, `pip install dateutils`), is a distinct, less actively maintained package. It acts as a wrapper around the much more widely used and actively developed `python-dateutil` library (installed via `pip install python-dateutil`, imported as `import dateutil`). Always ensure you are installing and importing the correct library for your needs.fixIf intending to use the core `dateutil` functionalities (parsing, `relativedelta`, timezones), install `python-dateutil` (`pip install python-dateutil`). If you specifically require the wrapper features of *this* `dateutils` library, be mindful of its lower maintenance status and explicit import path.
affects: All versions
deprecatedProject Maintenance Status: The `dateutils` library (jmcantrell/python-dateutils) has not seen a new release since October 2020. While functional, it relies on `python-dateutil` for its core logic, which is actively maintained. Users should be aware that direct support or new features for `dateutils` itself are unlikely.fixFor general robust datetime handling, parsing, and relative deltas, consider using `python-dateutil` directly (version 2.x and above) or Python's built-in `datetime` and `zoneinfo` modules (for Python 3.9+). If specific functionalities of this `dateutils` wrapper are essential, be prepared to adapt or maintain the code yourself.
affects: 0.6.12 and earlier
Upgrade
Version history
0.6.12latest on PyPI · released Oct 23, 2020
Audit
Dependencies
python-dateutilrequiredThis library is a wrapper that heavily relies on `python-dateutil` for its core datetime manipulation features.