delta
Human friendly context aware duration parsing library
What it is and what it does
Delta is a duration-parsing library that converts natural-language time expressions into Python timedelta objects. It accepts strings like '1 year 2 months and 3 weeks' or shorthand like '1y 2m 3w 4d' and returns the equivalent timedelta. The library includes a context-aware mode: when you provide a datetime object as context, it correctly calculates months and years by accounting for the actual calendar, rather than using fixed day counts.
The package exports a single parse() function and supports units from milliseconds to years. It has no external runtime dependencies, making installation straightforward in principle. However, the package has been abandoned since 2016-08-06 with no updates for years, and Python version compatibility is unspecified, creating uncertainty about whether it will work reliably on modern Python versions.
Use it for:
- Parse user input like '3 days and 2 hours' into timedelta for scheduling or timeout calculations
- Calculate accurate date offsets by months or years using context-aware parsing with a reference date
- Convert shorthand duration notation from configuration files or CLI arguments into timedelta objects
- Build duration-based filters or queries that accept human-readable time expressions
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses human-readable duration strings like '1 hour' or '2 months and 3 weeks' into Python timedelta objects, with optional context-aware calculation for months and years.
No—install only if you have no alternative and can verify compatibility with your Python version. The package is abandoned (last update 2016-08-06), has high install friction, and Python compatibility is unspecified. Modern alternatives may be safer choices for production use.
Install
delta on PyPI
pip
pip install deltauv
uv add deltapoetry
poetry add deltaInstalling delta
Before you install
High install friction: the package is abandoned (last commit 2020-06-01, no releases since 2016-08-06) and has no runtime dependencies. Maintenance status poses a significant risk for bug fixes or compatibility updates.
License in practice
MIT license is permissive and poses no restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
pip install delta
import delta
from datetime import datetime
tdelta = delta.parse('1 day')
tdelta_context = delta.parse('2 months', context=datetime(2016, 1, 1))
No Python version requirement specified in the package metadata; compatibility with modern Python versions is unknown.
Verify before relying
- Whether the package works with Python 3.x versions (no version requirement specified)
- Whether context-aware parsing correctly handles all calendar variations
- Whether the package is maintained or has a maintained fork available
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,660 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 603,472/month — #5,810 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: delta-0.4.2.tar.gz
Keywords: date, durations, timedelta
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
agoConverts datetime, timedelta, and timestamp…
permissive · top 15,000 on PyPI
datedeltadatedelta extends Python's datetime module with…
permissive · top 15,000 on PyPI
durationpyConverts between Python's `datetime.timedelta`…
permissive · top 1,000 on PyPI
snaptimeSnaptime transforms timestamps using a simple…
unclear · top 15,000 on PyPI
about-timeMeasures execution time and throughput of code…
permissive · top 5,000 on PyPI
pytimeparse2Parses human-readable time expressions (like…
permissive · top 5,000 on PyPI
pytimeparseParses human-readable time expressions (like…
permissive · top 1,000 on PyPI
isodurationParses and manipulates ISO 8601 duration…
permissive · top 1,000 on PyPI
timeagoFormats datetime objects and timedeltas into…
permissive · top 5,000 on PyPI
ctparseParses natural language time expressions (like…
permissive · top 15,000 on PyPI