datefinder
Extract datetime objects from natural language text
What it is and what it does
Datefinder is a Python date parser designed to extract date and time expressions from unstructured text. It handles explicit calendar dates (e.g., "January 4th, 2017" or "2024-11-03 18:00"), relative expressions ("tomorrow", "in 3 days"), and multiple date formats in a single pass. The package provides two main APIs: a compatibility layer that returns datetime objects, and a modern typed API that returns match objects with kind, text span, confidence, and structured values.
The package is useful for processing emails, contracts, logs, scraped HTML, and other mixed-format documents where dates are embedded in natural language. It includes a command-line interface for shell pipelines and supports anchoring relative date parsing to a reference date. As of version 1.0.0, the default engine uses a v2 compatibility implementation backed by Rust, with the original engine available as a fallback.
Use it for:
- Extract dates from email threads, support tickets, or conversation logs to organize or filter by date
- Parse contract or legal document dates to identify key deadlines and effective dates
- Find and normalize dates in scraped web content or mixed-format reports for data pipeline ingestion
- Process relative date expressions in user input (e.g., "due tomorrow") anchored to a specific reference date
- Migrate legacy date extraction code by using find_dates_legacy() for parity, then switching to the modern API
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Datefinder extracts date and time expressions from unstructured text and converts them into datetime objects or typed match objects with confidence and span information.
Yes, if you need to extract dates from unstructured text. The package is actively maintained, has no known vulnerabilities, and supports current Python versions. Install friction is moderate due to Rust compilation on unsupported platforms, but prebuilt wheels cover common targets. The MIT license is permissive. Consider it essential for document processing, log analysis, or data normalization tasks involving natural language dates.
Install
datefinder on PyPI
pip
pip install datefinderuv
uv add datefinderpoetry
poetry add datefinderInstalling datefinder
Before you install
Medium install friction due to Rust compilation requirement when prebuilt wheels are unavailable. The package is actively maintained with recent releases and provides prebuilt wheels for common platforms (Linux glibc/musl, macOS, Windows). Requires Python 3.9+.
License in practice
MIT license is permissive; you can use this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install datefinder
import datefinder
from datetime import datetime, timezone
text = "Meeting tomorrow; launch on 2024-11-03 18:00 UTC."
ref = datetime(2026, 3, 19, 12, 0, tzinfo=timezone.utc)
for match in datefinder.find_dates(text, base_date=ref):
print(match)
Requires Python 3.9+. If a prebuilt wheel is unavailable for your platform, pip will build from source and requires a Rust toolchain.
Verify before relying
- Accuracy and coverage of date extraction compared to alternatives like dateparser or Duckling
- Performance characteristics on very large documents or high-volume batch processing
- Behavior differences between v2 (default) and legacy engines for edge cases in your use case
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 3 — regex, python-dateutil, pytz |
| Maintenance | actively maintained — 142 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,546,158/month — #2,284 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: datefinder-1.0.0-cp39-abi3-macosx_10_12_x86_64.whl; datefinder-1.0.0-cp39-abi3-macosx_11_0_arm64.whl; datefinder-1.0.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; datefinder-1.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; datefinder-1.0.0-cp39-abi3-musllinux_1_2_aarch64.whl; datefinder-1.0.0-cp39-abi3-musllinux_1_2_x86_64.whl; datefinder-1.0.0-cp39-abi3-win_amd64.whl
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
commonregexExtracts dates, times, emails, phone numbers,…
permissive · top 15,000 on PyPI
dateparserParses dates from text in multiple languages…
permissive · top 1,000 on PyPI
date-spacyAdds a spaCy pipeline component that identifies…
permissive · top 15,000 on PyPI
ctparseParses natural language time expressions (like…
permissive · top 15,000 on PyPI
parsedatetimeParses human-readable date and time strings…
permissive · top 1,000 on PyPI
timelibParses natural-language date and time…
permissive · top 15,000 on PyPI
htmldateExtracts original and updated publication dates…
permissive · top 5,000 on PyPI
date-guesserExtracts publication dates from web pages by…
permissive · top 15,000 on PyPI
nr-dateA pure-Python date parser using regex patterns…
permissive · top 15,000 on PyPI
dateformatParses strings into datetime objects and…
permissive · top 15,000 on PyPI