dateparser

Python library that parses human-readable and relative dates from text across more than 200 language locales.

Library
PyPI
v1.4.2
2,853stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
83/100Excellent
Development Activity84
Maintenance64
Community84
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture82
Code Quality78
Innovation72
Learning Curve90

dateparser is a Python library for parsing dates and times out of human-readable text — absolute dates, relative expressions like “two weeks ago” or “tomorrow”, raw timestamps, and dates embedded inside longer strings — across more than 200 language locales with automatic language detection. A single dateparser.parse() call normalizes messy, inconsistently formatted date strings into standard Python datetime objects without the caller needing to know the source format or language ahead of time.

Built and maintained by Scrapinghub (Zyte) originally for web-scraping pipelines, it has grown into a general-purpose date-parsing dependency used well beyond scraping — anywhere multilingual or loosely formatted date text needs to become a reliable timestamp, including timezone-aware output, configurable date-order resolution, and a search_dates() function for pulling dates out of arbitrary text and even resolving fuzzy time spans like “past month” into concrete start/end datetimes.

What You Get

  • Locale-aware parsing across 200+ languages with automatic language detection
  • Support for absolute dates, relative expressions (“3 days ago”), and Unix timestamps in one API
  • search_dates() for extracting every date substring from a longer block of text
  • Time span detection that resolves phrases like “past month” into explicit start/end datetimes
  • A settings dict for controlling date order, timezone handling, and incomplete-date resolution
  • Optional non-Gregorian calendar support (Hijri, Jalali) via the calendars extra

Common Use Cases

  • Normalizing dates scraped from HTML pages with inconsistent or localized formatting
  • Parsing user-submitted date strings in multilingual web forms
  • Extracting publication dates from news articles and RSS/content feeds
  • Converting relative time expressions in chat or log messages into absolute timestamps

Under The Hood

Architecture Every call funnels through dateparser.parse() (dateparser/__init__.py) into a module-level DateDataParser singleton (dateparser/date.py), which orchestrates locale detection via LocaleDataLoader/custom_language_detection, dispatches to per-format parsers (_parse_absolute and _parse_nospaces in parser.py, freshness_date_parser.py for relative expressions) in the order set by settings.PARSERS, and finally normalizes timezone and day-of-month ambiguity through DateParser in date_parser.py. It’s a layered pipeline — sanitize, resolve locale, dispatch to the matching parser, normalize timezone — with dateparser/search built as a separate module on top of the same core for the search_dates() entry point, and locale/translation data loaded lazily and cached from dateparser_data/date_translation_data rather than compiled into the dispatch logic itself.

Tech Stack A pure Python 3.10+ package (setuptools build backend) with a deliberately small runtime dependency footprint — python-dateutil for relative-delta arithmetic, pytz for the timezone database, regex for Unicode-aware pattern matching beyond stdlib re, and tzlocal for local timezone detection — plus optional extras (convertdate/hijridate for non-Gregorian calendars, langdetect for language auto-detection). It ships a small companion CLI (dateparser_cli, entry point dateparser-download) for managing cached detection models, and is tested across a tox.ini matrix spanning Python 3.10 through 3.14 with separate GitHub Actions workflows for CI, PyPI publishing, performance benchmarking (Codspeed), and continuous fuzzing (OSS-Fuzz/CIFuzz).

Code Quality An extensive test suite covers the parser core, freshness/relative parsing, timezones, search, thread safety, and pickling using pytest with parameterized.expand for locale-by-locale cases, wired into CI with pytest-cov and Codecov reporting. Fuzz testing via OSS-Fuzz/atheris adds an unusually deep layer of quality assurance for a library this size. Linting and formatting are enforced through ruff (ruff --fix plus ruff-format) via pre-commit hooks integrated into the tox envlist. The main gap is static typing — no mypy configuration and largely untyped core modules (date.py, parser.py).

API Design dateparser optimizes for near-zero-boilerplate use: dateparser.parse("some date string") returns a datetime with no setup required, backed by a module-level default parser instance to avoid repeated initialization cost. Advanced control — date order, locale restriction, timezone behavior, strict parsing — is exposed through a single settings dict rather than a sprawling list of keyword arguments, keeping the common-case signature small while still reaching deep configurability; search_dates() mirrors the same ergonomics for text-extraction use cases. Documentation is strong, with dozens of runnable README examples and a full Read the Docs site, though the settings dict is stringly-typed rather than an enum/dataclass, and misconfiguration surfaces as a runtime SettingValidationError instead of being caught statically.

Used by 6 apps in this directory

Python
50%
Other

Airbyte

Developer Tools · Data Engineering

21,971

Open-source ELT platform with 600+ connectors for moving data from any source to warehouses, lakes, and AI agents.

View details
95
Repo Health
80
Technical
67
Dependency
Built with
Python50%
Kotlin41%
Updated today
Python
76%
MIT

ArchiveBox

Bookmarks Archiving

28,207

Self-hosted web archiving that saves HTML, PDFs, screenshots, media, and code in open formats you own forever

View details
88
Repo Health
84
Technical
70
Dependency
Built with
Python76%
HTML12%
Updated today
Python
51%
AGPL 3.0

Khoj

AI Assistants · Knowledge Management · Productivity

36,791

A self-hostable AI second brain that chats with your documents, searches the web, builds custom agents, and runs entirely on your own LLM.

View details
76
Repo Health
82
Technical
70
Dependency
Built with
Python51%
TypeScript36%
Updated 4 weeks ago
Python
62%
GPL 3.0

Paperless-ngx

Bookmarks Archiving

44,708

Turn your paper pile into a searchable digital archive with OCR, AI classification, and automated workflows — all running on your own server.

View details
91
Repo Health
88
Technical
70
Dependency
Built with
Python62%
TypeScript30%
Updated today
Python
69%
AGPL 3.0

Tracecat

Security · Automation · AI Agents

3,782

Open-source agentic security automation platform that runs AI agents and durable workflows at scale with sandboxed execution.

View details
89
Repo Health
88
Technical
66
Dependency
Built with
Python69%
TypeScript29%
Updated today
Python
91%
GPL 3.0

Weblate

Developer Tools

6,043

Continuous localization platform that commits translations directly into your version control system with full translator attribution.

View details
95
Repo Health
86
Technical
73
Dependency
Built with
Python91%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search