dateoxide
Blazing-fast, low-memory, multilingual natural-language date parser written in Rust — a full-featured drop-in replacement for Python's dateparser.
dateoxide replaces runtime Python regex compilation and 205 dynamically imported locale modules with a compiled zero-backtracking Rust engine (dateoxide-core) exposed to Python via PyO3 + maturin.
- 108x – 7,210x faster single-threaded parsing (
977x – 36,034xwith GIL-free parallelparse_batch) - 7.4x lower memory footprint (
+6.93 MBvs+51.56 MBRSS delta across 205 languages) - 17.3x faster cold import (
5.21 msvs90.22 ms) via PEP 562 lazy submodules - Zero ReDoS — linear-time parsing with zero catastrophic backtracking
- 3,102+ automated tests passing in <4s — including 1,010 upstream
scrapinghub/dateparsertest vectors, exactdatetimeassertions across 205 languages,dateparsercompatibility & fuzzing matrices, knowndateparserbug regressions, and 3,792 official Saudi Umm al-Qura Hijri dates - Official Saudi Umm al-Qura Hijri Calendar (1343–1500 AH) embedded directly in pure Rust (3,792/3,792 month-start & month-end dates verified against
hijridate, with zero runtime dependencies), plus Jalali, Minguo, and French Republican calendars - Complete
dateparserfeature parity:parse(),DateDataParser(get_date_data,get_date_tuple,parts,part_of_day),search_dates(..., add_period=..., add_detected_language=...)Settings,SettingValidationError,PartOfDay,PartsOfDay,apply_settings,confFreshnessDateDataParser(freshness_date_parser) &timezone_parser.pop_tz_offset_from_stringutils.time_spans(detect_time_span,generate_time_span,RETURN_TIME_SPAN,DEFAULT_START_OF_WEEK,DEFAULT_DAYS_IN_MONTH)IGNORE_SURROUNDING_TEXT,STRICT_DATE_ORDER,NORMALIZE,PARSERS,SKIP_TOKENS,RETURN_TIME_AS_PERIOD,TIMEZONE_ABBREVIATIONS,region, anddetect_languages_function
Benchmarks
Measured with benchmarks/bench_vs_dateparser.py on Python 3.12.10, dateparser 1.5.1, Rust 1.99.1 (--release with thin LTO).
Cold Import & Memory Footprint (Isolated Subprocesses)
| Metric | dateparser (Python) |
dateoxide (Rust) |
Improvement |
|---|---|---|---|
| Cold import time | 90.22 ms | 5.21 ms | 17.3x faster |
| RSS after import | +8.06 MB | +0.76 MB | 10.6x smaller |
| RSS delta after parsing | +51.56 MB | +6.93 MB | 7.4x less RAM |
Parsing Throughput (Operations / Second)
| Workload | dateparser.parse |
dateoxide.parse |
dateoxide.DateDataParser |
dateoxide.parse_batch (Rayon) |
|---|---|---|---|---|
| ISO / RFC / Numeric | 440 /s | 672,789 /s (1,531x) | 3,168,819 /s (7,210x) | 5,364,615 /s (12,206x) |
| Multilingual Natural Language (Auto) | 1,239 /s | 133,916 /s (108x) | 160,849 /s (130x) | 1,211,446 /s (977x) |
| Invalid / Non-Date Text (Worst Case) | 60 /s | 196,333 /s (3,279x) | 262,130 /s (4,378x) | 2,157,386 /s (36,034x) |
Reproduce locally (or run the accuracy-checked torture suite):
Independent Torture Benchmark (Accuracy, ReDoS & Known Differences)
Measured with benchmarks/torture_benchmark.py across 79 adversarial cases (multilingual casing/scripts, month-end clamping, leap/ISO-week traps, RFC/CLF/DST, false-positive traps), dirty search_dates, and 6 ReDoS stress bombs (dateoxide 0.1.0 vs dateparser 1.5.1 on Windows 11, 32-core, Python 3.12.10):
| Metric | dateparser 1.5.1 |
dateoxide |
|---|---|---|
| Torture accuracy (79 hard cases) | 66 / 79 (1,675.90 ms) |
74 / 79 (0.77 ms) |
Dirty search_dates (6 docs) |
4 / 6 (678.77 ms) |
5 / 6 (0.47 ms) |
| 6 ReDoS stress bombs (3k–5k chars) | 8,298.90 ms |
2.51 ms |
| Full 79-case isolated throughput & RSS | 134.0 /s (+64.79 MB) |
38,938.5 /s (+10.21 MB) (290.6x) |
Transparently noted misses & differences (5 / 79 on dateoxide):
"the day after tomorrow"returnsNone("day after tomorrow"works; leading"the"isn't stripped yet;dateparserparses it)."quarter past 3"and"two and a half hours ago"returnNonein bothdateoxideanddateparser."last Friday"preservesRELATIVE_BASEtime (15:00) indateoxide, whereasdateparserresets time to00:00."2026-13-01"swaps to2026-01-13under defaultSTRICT_DATE_ORDER="none"in both libraries (setSTRICT_DATE_ORDER="all"to reject).
Upstream dateparser Bugs Fixed / Avoided
Tested directly in tests/test_dateparser_bugs.py:
- Compact ISO-8601 basic (
20261126T153000Z):dateparser 1.5.1misparses this as year1608-01-02;dateoxidereturns2026-11-26 15:30:00+00:00. - Quadratic ReDoS & punctuation runs (
GHSA-rx9v-94ff-9cc2,#426):5,000repeated dots/dashes/Arabic commas returnNonein microseconds. - Long-running memory & latency stability (
#457,#1140): Stateless Rust core with zero unboundedprevious_localesgrowth. - Timestamp fragmentation in
search_dates(#968):"Server rebooted at 2026-11-26 15:30:00 UTC successfully."stays grouped as a single combined match. - Extreme overflow protection: Inputs like
"+999999999999999 days ago"or"5000 years ago"cleanly returnNoneinstead of overflowing or raising out-of-range errors. - Turkish
İ/I/ıcasing & leap/month-end clamping:"15 OCAK 2026","3 GÜN ÖNCE","DÜN SAAT 14:30"work out of the box without false-positive city names like"İSTANBUL".
Quick Start (Python)
Drop-in replacement for dateparser
# bare relative durations
# diacritic-folded normalization
# time-of-day phrases
# Korean
# Japanese / Chinese
# Arabic-Indic numerals
# Compact ISO-8601
Settings, PartsOfDay, DateData.parts, and DateData.part_of_day
=
=
=
# 2026-11-25 08:30:00 ('year', 'month', 'day', 'time') PartOfDay.MORNING
Non-Gregorian Calendars (Zero-Dependency Native Rust)
# 2025-11-26
# 2025-03-01 (Official Umm al-Qura)
# 2026-11-26
# 1795-04-03
Time Spans, Freshness Parser & search_dates
=
, =
=
# [('December 2025', datetime(2025, 12, ...), 'month', 'en'), ('12 Jan 2026', datetime(2026, 1, 12, 0, 0), 'day', 'en')]
Parallel Batch Parsing (GIL-free, Multi-Core)
= * 25_000
= # Runs across all CPU cores via Rayon
Real-World Examples (examples/)
examples/telegram_reminder_bot.py— Multilingual Telegram reminder parser & UTC schedulerexamples/log_pipeline.py— Mixed Nginx CLF / RFC 3339 / bracketed log normalizer withparse_batchexamples/big_data_parser.py— 50,000-record multilingual ETL throughput & RSS demo
Standalone Rust Usage (dateoxide-core)
dateoxide-core has zero Python dependencies and can be used directly in Rust applications:
use ;
let dt = parse.unwrap;
let found = search_dates;
let batch = parse_batch;
let jalali = parse_jalali;
let hijri = parse_hijri;
Architecture: Why Is It So Fast & Lean?
- Zero-Regex Byte Scanner Fast Path (
fast_path.rs): Extended & compact ISO-8601, RFC-2822/3339, delimited numeric dates, standalone compact times (5:30p.m.,09h15), and Unix timestamps are parsed directly from bytes without touching regexes or locale tables. - Compile-Time Binary Locale Database (
build.rs+postcard): All 205 languages (including script-tagged locales likeaz-Cyrl,sr-Latn,uz-Cyrl) are compiled at build time into a compact embedded binary (include_bytes!) lazily loaded viaOnceLockon first natural-language parse — eliminating Python's 205-module import tax. - Zero-Regex Structured Relative Patterns (
relative.rs): 99.97% ofdateparser's 3,621relative-type-regexentries are pure<prefix><NUMBER><suffix>shapes.dateoxidepre-compiles them into flat prefix/suffix matchers with guaranteed linear time and zero ReDoS risk, plus multi-sense relative disambiguation (PREFER_DATES_FROM), bare durations, and configurablePartsOfDay. - O(tokens) Inverted Language Index + Diacritic Folding (
locale/mod.rs): Instead of iterating through 205 languages on unknown input,dateoxidescores exact and diacritic-folded tokens inFxHashMaplookups (plus Unicode script detection for Korean, Japanese, Chinese, Cyrillic, Arabic, Greek, Hebrew, Thai, Devanagari), rejecting non-date strings in microseconds. - Native Rust Calendars & Time Spans (
calendars.rs,umm_al_qura.rs,time_spans.rs): Official Saudi Umm al-Qura Hijri lookup table (1343–1500 AH), Solar Hijri (Jalali), Minguo, and French Republican calendar arithmetic plus compiled linear-time span detection. - GIL-Free Rayon Parallelism (
parse_batch): Releases Python's GIL viapy.allow_threadsand fans out across all CPU cores with Rayon.
Development & Publishing
# Build & install release Python extension locally
# Run Rust core tests
# Run full 3,000+ test suite (including parity matrix, fuzzing & Umm al-Qura Hijri)
# Run standard & torture head-to-head benchmarks vs dateparser
Automated PyPI (OIDC Trusted Publishing) and crates.io multi-platform wheel builds trigger on release tags:
&&
License & Attribution
Dual-licensed under MIT or Apache-2.0.
Multilingual calendar and relative-date lexical data is derived from Unicode CLDR and scrapinghub/dateparser (BSD 3-Clause License). Official Saudi Umm al-Qura month-start data (1343–1500 AH) is derived from dralshehri/hijridate (MIT License). See LICENSE and NOTICE for full details.