Skip to main content

dateoxide

CI PyPI version crates.io docs.rs Python versions License: MIT OR Apache-2.0

Blazing-fast, low-memory, multilingual natural-language date parser written in Rust — a full-featured drop-in replacement for Python's dateparser.

pip install dateoxide        # Python (pre-built cp39-abi3 wheels: Linux, macOS, Windows)
cargo add dateoxide-core     # Pure Rust crate

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,034x with GIL-free parallel parse_batch)
  • 7.4x lower memory footprint (+6.93 MB vs +51.56 MB RSS delta across 205 languages)
  • 17.3x faster cold import (5.21 ms vs 90.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/dateparser test vectors, exact datetime assertions across 205 languages, dateparser compatibility & fuzzing matrices, known dateparser bug 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 dateparser feature 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, conf
    • FreshnessDateDataParser (freshness_date_parser) & timezone_parser.pop_tz_offset_from_string
    • utils.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, and detect_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):

python benchmarks/bench_vs_dateparser.py
python benchmarks/torture_benchmark.py --json

Independent Torture Benchmark (Accuracy, ReDoS & Known Differences)

Measured with benchmarks/torture_benchmark.py across 79 adversarial cases (multilingual casing/scripts, fractional/conversational phrases, month-end clamping, leap/ISO-week traps, RFC/CLF/DST, false-positive traps), dirty search_dates, and 6 ReDoS stress bombs (dateoxide 0.2.0 vs dateparser 1.5.1 on Python 3.12.10):

Metric dateparser 1.5.1 dateoxide 0.2.0
Torture accuracy (79 hard cases) 66 / 79 (4,243.30 ms) 78 / 79 (1.60 ms)
Dirty search_dates (6 docs) 4 / 6 (1,885.91 ms) 6 / 6 (0.48 ms)
6 ReDoS stress bombs (3k–5k chars) 20,111.62 ms 5.46 ms
Full 79-case isolated throughput & RSS 57.4 /s (+64.52 MB) 20,629.9 /s (+10.24 MB) (359.4x)

Transparently noted difference (1 / 79):

  • "2026-13-01" swaps to 2026-01-13 under default STRICT_DATE_ORDER="none" in both dateoxide and dateparser (set STRICT_DATE_ORDER="all" to reject invalid month indices strictly).

Upstream dateparser Bugs Fixed / Avoided

Tested directly in tests/test_dateparser_bugs.py:

  • Compact ISO-8601 basic (20261126T153000Z): dateparser 1.5.1 misparses this as year 1608-01-02; dateoxide returns 2026-11-26 15:30:00+00:00.
  • Quadratic ReDoS & punctuation runs (GHSA-rx9v-94ff-9cc2, #426): 5,000 repeated dots/dashes/Arabic commas return None in microseconds.
  • Long-running memory & latency stability (#457, #1140): Stateless Rust core with zero unbounded previous_locales growth.
  • 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 return None instead 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

import dateoxide as dateparser

dateparser.parse("3 days ago")
dateparser.parse("2 days")               # bare relative durations
dateparser.parse("3 gün önce")
dateparser.parse("3 gun once")           # diacritic-folded normalization
dateparser.parse("dün gece")             # time-of-day phrases
dateparser.parse("yesterday at noon")
dateparser.parse("vor 2 Wochen")
dateparser.parse("hier à 14h30")
dateparser.parse("12 de diciembre de 2025")
dateparser.parse("2026년 11월 26일")      # Korean
dateparser.parse("2026年11月26日")        # Japanese / Chinese
dateparser.parse("١٢ ديسمبر ٢٠٢٥")        # Arabic-Indic numerals
dateparser.parse("20261126T153000Z")     # Compact ISO-8601
dateparser.parse("Published: 12 December 2025", settings={"IGNORE_SURROUNDING_TEXT": True})

Settings, PartsOfDay, DateData.parts, and DateData.part_of_day

from datetime import time
from dateoxide import DateDataParser, PartsOfDay, Settings

cfg = Settings(
    DATE_ORDER="MDY",
    STRICT_DATE_ORDER="all",
    PARTS_OF_DAY=PartsOfDay(morning=time(8, 30)),
    TIMEZONE_ABBREVIATIONS={"FOO": "+04:30"},
)
parser = DateDataParser(settings=cfg)
dd = parser.get_date_data("yesterday morning")
print(dd.date_obj, dd.parts, dd.part_of_day)
# 2026-11-25 08:30:00 ('year', 'month', 'day', 'time') PartOfDay.MORNING

Non-Gregorian Calendars (Zero-Dependency Native Rust)

from dateoxide.calendars import (
    JalaliCalendar,
    HijriCalendar,
    MinguoCalendar,
    FrenchRepublicanCalendar,
)

JalaliCalendar("۵ آذر ۱۴۰۴").get_date()                 # 2025-11-26
HijriCalendar("1 Ramadan 1446").get_date()             # 2025-03-01 (Official Umm al-Qura)
MinguoCalendar("115年11月26日").get_date()             # 2026-11-26
FrenchRepublicanCalendar("14 Germinal an III").get_date()  # 1795-04-03

Time Spans, Freshness Parser & search_dates

from dateoxide.freshness_date_parser import freshness_date_parser
from dateoxide.search import search_dates
from dateoxide.utils import time_spans

freshness_date_parser.parse("3 gün önce")
span = time_spans.detect_time_span("Show errors from past 3 days")
start, end = time_spans.generate_time_span(span)

matches = search_dates(
    "Event in December 2025; follow-up 12 Jan 2026",
    add_period=True,
    add_detected_language=True,
)
# [('December 2025', datetime(2025, 12, ...), 'month', 'en'), ('12 Jan 2026', datetime(2026, 1, 12, 0, 0), 'day', 'en')]

Parallel Batch Parsing (Nullable) & Date Ranges

import dateoxide

dates = ["2026-11-26", None, "3 gün önce", "vor 2 Wochen", "not a date"]
results = dateoxide.parse_batch(dates)  # GIL-free Rayon across all CPU cores

start, end = dateoxide.parse_date_range("12 Ocak - 15 Şubat 2026")
start, end = dateoxide.parse_date_range("March 10-14, 2026")
start, end = dateoxide.parse_date_range("from 2026-11-01 to 2026-11-15")

Language Support Tiers (205 Languages)

Tier Count Included Capabilities Languages
Tier 1 (Full NLP) 40 12 months, 7 weekdays, relative_exact, relative_affix, word_numbers, time_of_day en, tr, de, fr, es, pt, it, nl, ru, pl, uk, cs, sk, sv, da, nb/no, fi, ro, hu, el, he, ar, fa, ur, hi, bn, id, ms, vi, th, zh, ja, ko, az, uz, kk, bg, hr, sr, ca
Tier 2 (Full Calendar + Relative) 121 12 months, 7 weekdays, relative_exact, dynamic relative_affix (N units ago/in) Tier 1 + 81 additional world languages (African, South/SE Asian, Celtic, Baltic, Caucasian, etc.)
Tier 3 (CLDR Calendar + Exact Relatives) 205 12 months, 7 weekdays, units, 204 relative_exact phrases, Unicode numerals All 205 Unicode CLDR / dateparser locales

(Multilingual time_spans covers 13 languages: EN, TR, DE, FR, ES, IT, PT, NL, PL, RU, JA, ZH, KO.)

Real-World Examples (examples/)

python examples/telegram_reminder_bot.py
python examples/log_pipeline.py
python examples/big_data_parser.py

Standalone Rust Usage (dateoxide-core)

dateoxide-core has zero Python dependencies and can be used directly in Rust applications:

use dateoxide_core::{calendars, parse, parse_batch, search_dates, settings::Settings};

let dt = parse("3 gün önce").unwrap();
let found = search_dates("Meeting on 12 December 2025", &Settings::default());
let batch = parse_batch(&["2026-11-26", "vor 2 Wochen", "3日前"], &Settings::default());
let jalali = calendars::parse_jalali("۵ آذر ۱۴۰۴", &Settings::default());
let hijri = calendars::parse_hijri("1446/09/01", &Settings::default());

Architecture: Why Is It So Fast & Lean?

  1. 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.
  2. Compile-Time Binary Locale Database (build.rs + postcard): All 205 languages (including script-tagged locales like az-Cyrl, sr-Latn, uz-Cyrl) are compiled at build time into a compact embedded binary (include_bytes!) lazily loaded via OnceLock on first natural-language parse — eliminating Python's 205-module import tax.
  3. Zero-Regex Structured Relative Patterns (relative.rs): 99.97% of dateparser's 3,621 relative-type-regex entries are pure <prefix><NUMBER><suffix> shapes. dateoxide pre-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 configurable PartsOfDay.
  4. O(tokens) Inverted Language Index + Diacritic Folding (locale/mod.rs): Instead of iterating through 205 languages on unknown input, dateoxide scores exact and diacritic-folded tokens in FxHashMap lookups (plus Unicode script detection for Korean, Japanese, Chinese, Cyrillic, Arabic, Greek, Hebrew, Thai, Devanagari), rejecting non-date strings in microseconds.
  5. 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.
  6. GIL-Free Rayon Parallelism (parse_batch): Releases Python's GIL via py.allow_threads and fans out across all CPU cores with Rayon.

Development & Publishing

# Build & install release Python extension locally
maturin develop --release

# Run Rust core tests
cargo test -p dateoxide-core --release

# Run full 3,000+ test suite (including parity matrix, fuzzing & Umm al-Qura Hijri)
pytest -v

# Run standard & torture head-to-head benchmarks vs dateparser
python benchmarks/bench_vs_dateparser.py
python benchmarks/torture_benchmark.py

Automated PyPI (OIDC Trusted Publishing) and crates.io multi-platform wheel builds trigger on release tags:

git tag v0.1.0 && git push --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.

Metadata

Release files for dateoxide 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dateoxide 0.3.0
File Size Uploaded Provenance Actions
dateoxide-0.3.0.tar.gz 180.7 kB With provenance Details for dateoxide-0.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for dateoxide 0.3.0
File Actions
dateoxide-0.3.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for dateoxide-0.3.0-cp39-abi3-win_amd64.whl
dateoxide-0.3.0-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details for dateoxide-0.3.0-cp39-abi3-musllinux_1_2_x86_64.whl
dateoxide-0.3.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for dateoxide-0.3.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
dateoxide-0.3.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for dateoxide-0.3.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
dateoxide-0.3.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for dateoxide-0.3.0-cp39-abi3-macosx_11_0_arm64.whl
dateoxide-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for dateoxide-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 8.6 MB

Release files / dateoxide-0.3.0.tar.gz

Download URL dateoxide-0.3.0.tar.gz
Size 180.7 kB
Tags Source
SHA-256 checksum
How to use checksums
73870b404f6dcabee6df56f07ff06a0684da404d684950ff3c8654200187c471
BLAKE2b-256 checksum
How to use checksums
fe41f7209539b9c2226ee46241d108d52d13bb289acd3b59b84028c1cb40bbb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / dateoxide-0.3.0-cp39-abi3-win_amd64.whl

Download URL dateoxide-0.3.0-cp39-abi3-win_amd64.whl
Size 1.3 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
4384a58591da88e08a3a2ff5c5f5691da1ff4118353d46f610441a0fff36760c
BLAKE2b-256 checksum
How to use checksums
c4641d8b2523e951766e6331a89f8399d74e870da04b168b1de4e9c1f1861eb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / dateoxide-0.3.0-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL dateoxide-0.3.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 1.7 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
9123e34161f8bf6d9eae3610c572a234634e8020e5c45ebaf836c09b8d6d0f49
BLAKE2b-256 checksum
How to use checksums
8fa823357b9f9417fd3581ff31407a3ac603d35dbc8e7095df4364746e9f94fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / dateoxide-0.3.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL dateoxide-0.3.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.4 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
34cf4a2c5d2b71fae6299676433d31e2a0bc07303fd83f8379a78f42e2f6721d
BLAKE2b-256 checksum
How to use checksums
d30414661740a8300d80c9190fae001453c22f99f77f1f2893db1f33f0a7baa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / dateoxide-0.3.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL dateoxide-0.3.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.4 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
a2443a09162718840856130eb9ec5c789f32d6fb5c1757024e99d4d693094bc3
BLAKE2b-256 checksum
How to use checksums
e1b38485d48bb8a425a4542c43c0852bb59722174a80526ebf1f233451b1ba30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / dateoxide-0.3.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL dateoxide-0.3.0-cp39-abi3-macosx_11_0_arm64.whl
Size 1.3 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
36bf1ba7a79c49945edb5228f896f604072036b7fdc3c3a32685da425c839ff5
BLAKE2b-256 checksum
How to use checksums
b18ddf0b3116261687960480b6a80c6d21ad2daba70edee0d60b59675eae10c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / dateoxide-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL dateoxide-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 1.3 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
4470b89244bb9ee3d378c0d7f7f8e80343bc07acb99e37f36b519678018ecd39
BLAKE2b-256 checksum
How to use checksums
3ef9d8a1d906f51d31cf0eaaf9ac4ff7b68828104159ab9bd678baa9babfd65e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for dateoxide 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for dateoxide-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page