Skip to main content

gnosis-date-parser

Perform fast fuzzy parsing of dates in varying formats.

Background

Numerous prior projects to perform fuzzy date parsing are available on PyPI. The best of these appears to be https://pypi.org/project/dateparser/, but I have not tried all of them. All of those which I have seen are written in pure-Python, and consequentially are too slow to use when the requirement is to parse tabular data with hundreds of thousands of dates in an interactive manner (e.g. at the time of data upload to a website where an immediate response is needed).

In many cases—arguably including the one motivating creation of this library—transferring the slow operation to a background batch operation is a reasonable approach. However, I learned of the very fast Rust library: https://crates.io/crates/dateparser. This is is approximately as powerful in recognizing many date formats as are any of the Python libraries I explored.

What I have used in the past is the fuzzy date matching in Pandas; this is good, but for numerous other reasons, I wish to move away from Pandas (mostly in favor of Polars). However, one area where Pandas currently shines above Polars is in parsing heterogenous dates defined in the same column of source data. Yes, that is bad data and its provider should do better. In the real world, a lot of data looks that way.

This library is a thin wrapper around the existing Rust dateparser. It was mostly created with the aid of an AI assistant. Although commit messages attribute this Claude, the underlying model used was a slightly customized version of MiniMax M3 that was hosted by a smaller AI vendor. I simply used the Claude Code CLI as a way of interacting with the code and model.

This library is thousands of times faster than any pure-Python library for a similar task. It is around 50x faster than similar capability in pandas.to_datetime(..., format="mixed").

Design

This Python module exposes three parsing functions. The Rust library created for this binding adds very little to the capabilities of crates it uses.

  • parse(raw: str) -> str | None — accepts a single raw date string and returns its ISO-8601 representation (or None for inputs the parser can't handle).

  • parrse_list(raw_dates: list[str]) -> list[str | None] — accepts a list of raw date strings and returns a list of ISO-8601 strings (or None for inputs the parser can't handle). The returned list matches the input length and order. This is the bulk-list path: one Rust call for the whole list.

  • parse_series(s: pl.Series) -> pl.Series — accepts a Polars Series of string dtype and returns a Polars Series of pl.Datetime("ns") (naive UTC, nanosecond precision). Unparseable strings become null values in the result. The Polars path works directly on the underlying Arrow buffer via pyo3-polars, so there is no Python-level iteration or list materialization.

Polars is an optional dependency: without it installed, calling parse_series() raises an ImportError pointing to the [polars] extra.

All three paths use the same parsing logic.

>>> import date_parser
>>> date_parser.parse("2026-01-01")
'2026-01-01 00:00:00+00:00'
>>> date_parser.parse("garbage") is None
True
>>> date_parser.parse_list(["2026-01-01", "garbage", "06/15/2024"])
['2026-01-01 00:00:00+00:00', None, '2024-06-15 00:00:00+00:00']

>>> import polars as pl
>>> date_parser.parse_series(pl.Series(["2026-01-01", "garbage"])).dtype
Datetime('ns')

Note: parsed datetimes are normalized to UTC (+00:00), matching the behavior of the dateparser Rust crate.

Pure-numeric inputs (e.g. "1511648546") are interpreted as Unix timestamps and forced to UTC: 10 digits = seconds, 13 = milliseconds, 16 = microseconds, 19 = nanoseconds.

Installation

parse() and parse_list() have no Python dependencies beyond the Rust extension itself:

pip install gnosis-date-parser

The Polars-based parse_series() requires the optional extra:

pip install "gnosis-date-parser[polars]"

Benchmarking

bin/benchmark.py measures throughput of the three date_parser functions, of the pure-Python dateparser, and of Pandas:

usage: benchmark.py [-h] [--examples EXAMPLES]
                    [--library {date_parser,date_parser_list,...}]
                    [--iterations ITERATIONS] [--warmup WARMUP] [--verbose]
                    [--quiet]

[...]                    

On my system I see:

% uv run python bin/benchmark.py -q
dateparser (https://pypi.org/project/dateparser/):       147 d/s
pandas — pd.to_datetime(format='mixed')          :    40,363 d/s
date_parser — parse() per input                  : 1,164,578 d/s
date_parser — parse_list bulk API                : 1,294,147 d/s
date_parser — parse_series Polars API            : 1,992,147 d/s

Local development

The project uses uv for environment and dependency management.

# Create a venv and install dev dependencies (maturin, pytest, ruff,
# mypy, mkdocs-material, ipython).
uv sync --extra dev

# Compile the Rust extension and install it editable into the venv.
uv run maturin develop --release

# Run the smoke tests (parse, parse_list, parse_series).
uv run pytest -q

# Lint and typecheck.
uv run ruff check .
uv run mypy bin tests date_parser

License

BSD-2-Clause. See LICENSE.

Metadata

Release files for gnosis-date-parser 1.1.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 gnosis-date-parser 1.1.0
File Size Uploaded Provenance Actions
gnosis_date_parser-1.1.0.tar.gz 161.0 kB With provenance Details for gnosis_date_parser-1.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for gnosis-date-parser 1.1.0
File Actions
gnosis_date_parser-1.1.0-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details for gnosis_date_parser-1.1.0-cp310-abi3-win_arm64.whl
gnosis_date_parser-1.1.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for gnosis_date_parser-1.1.0-cp310-abi3-win_amd64.whl
gnosis_date_parser-1.1.0-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for gnosis_date_parser-1.1.0-cp310-abi3-musllinux_1_2_x86_64.whl
gnosis_date_parser-1.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for gnosis_date_parser-1.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
gnosis_date_parser-1.1.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for gnosis_date_parser-1.1.0-cp310-abi3-macosx_11_0_arm64.whl
gnosis_date_parser-1.1.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for gnosis_date_parser-1.1.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 27.3 MB

Release files / gnosis_date_parser-1.1.0.tar.gz

Download URL gnosis_date_parser-1.1.0.tar.gz
Size 161.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f7b991a744e3a27925bd767473199b5439360594e340b284d86f29af4a2fd7d8
BLAKE2b-256 checksum
How to use checksums
9165d626ec33516eba2189e879a7ec18769ba6ba33b8b1b12ba5b1bcbfbfea10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / gnosis_date_parser-1.1.0-cp310-abi3-win_arm64.whl

Download URL gnosis_date_parser-1.1.0-cp310-abi3-win_arm64.whl
Size 4.4 MB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
6ae5fc8bb5539c7d6fce7d84b1080d330434df9dc30699a2aadce56468b21c8d
BLAKE2b-256 checksum
How to use checksums
3f00b3284bd61b3fdd9da2dcca0528939c352d7eadba3f71ff4dedc207de73ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / gnosis_date_parser-1.1.0-cp310-abi3-win_amd64.whl

Download URL gnosis_date_parser-1.1.0-cp310-abi3-win_amd64.whl
Size 5.0 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
499cb14db84ba80ba1234fa097a3878d20c194e7cad3f1f57b453453b47b62f7
BLAKE2b-256 checksum
How to use checksums
58f83b2988dc987683f9fd3c956d55382fe9d85b823bead9de8549f34fb28410
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / gnosis_date_parser-1.1.0-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL gnosis_date_parser-1.1.0-cp310-abi3-musllinux_1_2_x86_64.whl
Size 4.8 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
58038c56dda38d125f2e944534ec5c87ea58d515ee937a324bf598c93295a7e7
BLAKE2b-256 checksum
How to use checksums
cb7e65d12dc8fee4b4f1cbce5c6eebf04a3d83c034bce6494c56d31ddc7b001a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / gnosis_date_parser-1.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL gnosis_date_parser-1.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
02f973812dfb005661bf0efac99973ff970d65db3a839fe3996e2839fd49bc0a
BLAKE2b-256 checksum
How to use checksums
c3c402892455da0e339dabeb57865053463a3f40a3d8c0bfb0063ca8e2658b61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / gnosis_date_parser-1.1.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL gnosis_date_parser-1.1.0-cp310-abi3-macosx_11_0_arm64.whl
Size 4.0 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4ba820804c4256ea11858e34d0ac43f0ad5465a5155533a4bebbe6b81a1b1f42
BLAKE2b-256 checksum
How to use checksums
ca9da993340966d6076da08ee530f270c623087f52863e2a1bcb2f4ff8aafbc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / gnosis_date_parser-1.1.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL gnosis_date_parser-1.1.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 4.4 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ffa90f844ebc3882705aa9df2bd507598fc11c821bd209ffe8e268ad59b3a153
BLAKE2b-256 checksum
How to use checksums
f6ab27b9b16354d6783ddf99a5fedd2d9d96c14dce4ef57fdf2a64396419726e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Security for gnosis-date-parser 1.1.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 gnosis_date_parser-1.1.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 Oct 15, 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