timelib
parse english textual date descriptions
What it is and what it does
timelib is a thin Python wrapper around PHP's internal timelib C module, exposing two main functions: strtodatetime() converts English-language date descriptions into Python datetime objects, and strtotime() converts them into Unix timestamps. It leverages PHP's battle-tested date parsing logic to handle relative expressions ("next friday", "4 hours ago"), absolute dates, and arithmetic ("29 feb 2008 -108 years").
The package has no runtime dependencies and ships as a compiled extension. It is dormant—last released in March 2023 with no active maintenance—but the repository remains public and unarchived. Install friction is medium because it requires a pre-built wheel matching your Python version and CPU architecture; source builds need a C compiler and PHP timelib headers.
Use it for:
- Parse user-entered date strings in web forms or CLIs without requiring strict format specification
- Convert relative time expressions ("3 days from now", "last month") into exact datetime objects for scheduling or logging
- Migrate PHP date-parsing logic to Python while preserving the same parsing semantics
- Build natural-language query interfaces that accept fuzzy date ranges and convert them to timestamps
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses natural-language date and time descriptions (like "next friday" or "4 hours ago") into Python datetime objects or Unix timestamps using PHP's timelib module.
Yes, if you need natural-language date parsing and can install a pre-built wheel for your platform. The permissive dual license and zero runtime dependencies make it lightweight. However, dormancy (last release March 2023, no active maintenance) means no bug fixes or Python version updates are forthcoming—verify wheel availability for your Python version and architecture before committing, and consider alternatives if you need ongoing support or broader platform coverage.
Install
timelib on PyPI
pip
pip install timelibuv
uv add timelibpoetry
poetry add timelibInstalling timelib
Before you install
Medium install friction due to compiled extension (wheel available for cp39 on macOS arm64). Package is dormant—last release was 2023-03-18, last commit 2024-05-06; no active maintenance signal but repository remains public and unarchived.
License in practice
Dual-licensed under zlib/libpng and PHP License 3.01 (both permissive). You may use, modify, and redistribute freely in commercial and non-commercial contexts, provided you retain attribution and mark any alterations.
Quickstart
import timelib
# Parse natural language to datetime
dt = timelib.strtodatetime("next friday")
print(dt) # datetime.datetime(2009, 6, 26, 0, 0)
# Parse to Unix timestamp
import time
ts = timelib.strtotime("4 hours ago")
print(time.ctime(ts))
Requires a pre-built wheel for your Python version and platform; source builds need the C extension toolchain and PHP timelib headers.
Verify before relying
- Whether the package works with Python versions beyond 3.9 (python_support unspecified, only cp39 wheel evident)
- Current compatibility with modern macOS/Linux/Windows architectures beyond the single arm64 wheel shown
- Whether strtotime and strtodatetime handle timezone-aware parsing or always return naive datetimes
Package facts
| License | zlib/php (permissive) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,245 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 118,595/month — #12,114 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: timelib-0.3.0-cp39-cp39-macosx_12_0_arm64.whl
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
dateparserParses dates from text in multiple languages…
permissive · top 1,000 on PyPI
datefinderDatefinder extracts date and time expressions…
permissive · top 5,000 on PyPI
metomi-isodatetimeParses and manipulates ISO 8601 date-time…
copyleft · top 15,000 on PyPI
timeagoFormats datetime objects and timedeltas into…
permissive · top 5,000 on PyPI
agoConverts datetime, timedelta, and timestamp…
permissive · top 15,000 on PyPI
isodateParses and formats ISO 8601 date, time,…
permissive · top 1,000 on PyPI
aniso8601Parses ISO 8601 date, time, datetime, duration,…
permissive · top 5,000 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
pyRFC3339Parses and generates RFC 3339-compliant…
permissive · top 5,000 on PyPI
snaptimeSnaptime transforms timestamps using a simple…
unclear · top 15,000 on PyPI