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 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
dateparser (https://crates.io/crates/dateparser), which is as powerful in
recognizing many date formats as are any of the Python libraries I explored.
What I have used historically 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 the 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 and
chrono. 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 M2.7 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. I have not yet benchmarked it, but I believe it is also 10x+
faster than similar capability in pandas.to_datetime(..., format="mixed").
Design
The underlying Rust extension 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 (orNonefor inputs the parser can't handle). -
parse_list(raw_dates: list[str]) -> list[str | None]— accepts a list of raw date strings and returns a list of ISO-8601 strings (orNonefor 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 ofpl.Datetime("ns")(naive UTC, nanosecond precision). Unparseable strings become null values in the result. The Polars path works directly on the underlying Arrow buffer viapyo3-polars, so there is no Python-level iteration or list materialization.
All three paths use the same parsing logic via the
dateparser crate.
>>> 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. The Python dateparser library
preserves the original timezone offset; we don't (yet).
Pure-numeric inputs (e.g. "1511648546") are interpreted as Unix
timestamps and forced to UTC: 10 digits = seconds, 13 = milliseconds,
16 = microseconds, 19 = nanoseconds. The Python dateparser library
interprets these in the local timezone instead.
Installation
pip install gnosis-date-parser
Benchmarking
bin/benchmark.py measures throughput of the three date_parser
entry points side-by-side against the Python
dateparser and
[Pandas] (https://pandas.pydata.org):
usage: benchmark.py [-h] [--examples EXAMPLES]
[--library {date_parser,date_parser_list,...}]
[--iterations ITERATIONS] [--warmup WARMUP] [--verbose]
[--quiet]
Benchmark date_parser (the local Rust extension) against the formats in
options:
-h, --help show this help message and exit
--examples EXAMPLES Path to the examples file (default: /media/dmertz/DQM-
Backup/SEIU/gnosis-date-parser/tests/data/examples.txt)
--library, -l {date_parser,date_parser_list,date_parser_series,dateparser,pandas,all}
Which library to benchmark (default: all)
--iterations, -n ITERATIONS
Number of timed iterations (default: 5)
--warmup, -w WARMUP Number of warmup iterations to run before timing
(default: 1)
--verbose, -v Show per-mismatch detail (raw input, expected, actual)
in verification reports. Default: summary only.
--quiet, -q Print only one line per library — ``<label>:
<throughput>`` — and suppress the header, verification
report, and speedup comparison. Useful for scripts that
just want the numbers.
On my system, at version 1.0.4, I see:
% uv run python bin/benchmark.py -q
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
dateparser (https://pypi.org/project/dateparser/): 147 d/s
pandas — pd.to_datetime(format='mixed') : 40,363 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.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gnosis_date_parser-1.0.4.tar.gz | 161.0 kB | With provenance | Details for gnosis_date_parser-1.0.4.tar.gz |
Built distributions (wheels)
Total release size: 27.3 MB
Release files / gnosis_date_parser-1.0.4.tar.gz
| Download URL | gnosis_date_parser-1.0.4.tar.gz |
|---|---|
| Size | 161.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d55bd94f66049574b077d5950b124b098e913266cd021f479e8d44597e853a6
|
|
BLAKE2b-256 checksum How to use checksums |
0b90bffc094d6fb497cca269d33e0dba65bb361786807b0187c9d614c45830a3
|
| 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 Sep 21, 2026.
Transparency logRelease files / gnosis_date_parser-1.0.4-cp310-abi3-win_arm64.whl
| Download URL | gnosis_date_parser-1.0.4-cp310-abi3-win_arm64.whl |
|---|---|
| Size | 4.4 MB |
| Tags | CPython 3.10 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
51f5e19759ae37c1b8d0ddd93f149ce461f50cef322b3c527d527cb5ff77f9ab
|
|
BLAKE2b-256 checksum How to use checksums |
abb9ed93033bbcc984f31f2e4675930a252cfc317957bcd8b9c5cfe1a91889db
|
| 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 Sep 21, 2026.
Transparency logRelease files / gnosis_date_parser-1.0.4-cp310-abi3-win_amd64.whl
| Download URL | gnosis_date_parser-1.0.4-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 5.0 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
eac8b25feaa72b13c2d6294ca2fa0b0e5154a26a9bcdf54ece325be497665217
|
|
BLAKE2b-256 checksum How to use checksums |
3c122ebace501a028610b33daaf6fd9ad973c32ff239d0091ed114a1764841c8
|
| 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 Sep 21, 2026.
Transparency logRelease files / gnosis_date_parser-1.0.4-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | gnosis_date_parser-1.0.4-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 |
e780831b7127372e2099d41071160777bed226f12d8a7d56b88808f18102d6df
|
|
BLAKE2b-256 checksum How to use checksums |
dd6801f1194ec2164df04a2961517b5f5bfd059dd0431b2466625d9707e5cfc2
|
| 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 Sep 21, 2026.
Transparency logRelease files / gnosis_date_parser-1.0.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | gnosis_date_parser-1.0.4-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 |
05564e0bee27c6a68fc845d4121e5e3d3ed4354b57f207350b2501f693265a06
|
|
BLAKE2b-256 checksum How to use checksums |
ceec7d92d0d15acd4b3cbd6cd9e75287d1043d3994915a7de399e177627a7625
|
| 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 Sep 21, 2026.
Transparency logRelease files / gnosis_date_parser-1.0.4-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | gnosis_date_parser-1.0.4-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 |
15d94fe95a42aff06db5831cd3847e6a5a4134220be0f324dc5cf8ad31ab8007
|
|
BLAKE2b-256 checksum How to use checksums |
59b574c23ed00aad2f5bd39fbfcb2a1947bed09b24cb37c06f1359d429e4709a
|
| 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 Sep 21, 2026.
Transparency logRelease files / gnosis_date_parser-1.0.4-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | gnosis_date_parser-1.0.4-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 |
95fd5078ce81b5cdbf2da435dc4f9240dc37945f1d5f66ec390c28243d2f6e08
|
|
BLAKE2b-256 checksum How to use checksums |
6238c44f356cea3d2076db220295864f25229cc9d9397f4b95521b774db70b38
|
| 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 Sep 21, 2026.
Transparency logSecurity for gnosis-date-parser 1.0.4
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.
Attestation for gnosis_date_parser-1.0.4.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 Sep 21, 2026.
Transparency logA 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.