Python date parser that handles 200+ locales and relative dates

AI-generated summary of reporting by GitHub Opensource Projects. Read the original for the full story.

Why it matters

Developers parsing dates from multilingual user input or scraped text can skip writing custom regex and locale handling by installing dateparser, which handles 200+ locales and relative phrases.

Read this as

dateparser is a free, open-source Python library, released around 2015, that converts messy date text into usable date objects. Unlike Python's built-in tools, it understands dates written in over 200 languages and phrases like '2 weeks ago' or 'next Friday' without configuration. It also resolves ambiguous formats like 03/04/2024 based on the language context.

The article profiles dateparser, a mature open-source Python library (around since 2015) that any team handling dates in multiple languages could adopt at no cost. Its production track record includes Scrapinghub, the company behind Scrapy, using it on millions of date strings. The main risk is maintenance responsibility: it is community-supported rather than a commercial product. No support terms or licensing details are given.

dateparser parses date strings via language detection, locale-specific tokenization and fuzzy matching, returning Python datetime objects. It handles relative expressions ('il y a 3 jours'), locale-aware ambiguity via DATE_ORDER settings ('03/04/2024' as March 4 US, April 3 EU), and accepts languages/locales/settings parameters to hint parsing. No benchmark numbers are given; the stated production evidence is Scrapinghub's use at scale.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

dateparser Scrapy Python

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading