skillfed

delta

Human friendly context aware duration parsing library

delta v0.4.2 603.5K downloads/30d#5,810 on PyPI10
Permissive license MIT Abandoned released

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 delta

uv

uv add delta

poetry

poetry add delta

Installing 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

parse duration stringshuman readable time parsingtimedelta from textduration expression parsercontext aware date math
date-time-parsingabandoned

More Utilities packages