flashdate
A faster dateparser. Same API, same results, and the date formats that most data is written in are read in a few microseconds instead of a few hundred.
import flashdate as dateparser
dateparser.parse("2024-03-05T13:45:00Z")
dateparser.parse("March 5, 2024 1:45 PM")
dateparser.parse("le 5 mars 2024")
dateparser.parse("3 days ago")
flashdate is an independent, modified copy of dateparser 1.5.1. It is not made, endorsed or supported by the maintainers of dateparser: please report problems with it here, not to them.
Install
pip install flashdate
It installs next to dateparser, under its own import name, so you can run both in one program and compare them. Python 3.10 or later.
How much faster
Microseconds per date string, one thread, every string different, with CPython 3.12 on a standard GitHub Actions runner (Ubuntu, Intel Xeon 6975P-C). The table is copied from a run of the Benchmark workflow of this repository, which anyone can open, or start again in a fork.
| Format, with an example | dateparser | flashdate | Speedup |
|---|---|---|---|
2024-03-05 |
672 | 4.8 | 141x |
2024-03-05 13:45:00 |
896 | 5.4 | 166x |
2024-03-05T13:45:00Z |
1,388 | 5.4 | 259x |
2024-03-05T13:45:00+05:30 |
1,338 | 5.5 | 244x |
03/05/2024 |
679 | 5.3 | 129x |
25/03/2024 |
662 | 5.7 | 115x |
3/5/2024 13:45 |
830 | 5.7 | 146x |
March 5, 2024 |
691 | 5.3 | 131x |
Tue, 05 Mar 2024 13:45:00 GMT |
1,460 | 6.1 | 241x |
le 5 mars 2024 |
935 | 6.0 | 156x |
5 de marzo de 2024 |
877 | 6.2 | 141x |
5 Март 2024 |
841 | 6.3 | 133x |
3 days ago |
391 | 41.7 | 9x |
| Text that is not a date | 7,443 | 432 | 17x |
The times depend on the machine, the speedup much less. That run measured three
runners with three different processors: the first row took flashdate 3.9, 4.8
and 7.9 microseconds, and was 125, 141 and 133 times faster than dateparser.
Over the three, the formats above 3 days ago were 103 to 259 times faster,
3 days ago 8 to 10 times, and text that is not a date 16 to 19 times.
On the 300,000 article publication dates that dateparser keeps for its own evaluation, these fast paths read 80% of the dates. Parsing the 248,950 distinct strings of that set takes 63 seconds instead of 491, on one core of an Apple M-series laptop.
Date strings in other shapes go through the same steps as in dateparser, which
are also faster: 2 to 5 times for most of them. Among those are two-digit
years, hyphenated dates like 5-Mar-2024, dates with a time or a weekday in
languages other than English, and free-form phrases.
How much memory
Megabytes, with CPython 3.12 on a standard GitHub Actions runner (Ubuntu), from a run of the same workflow. Each case is parsed in a new process. Peak is the most memory the process held at any moment; Python alone peaks at 16.7. Kept is the memory of the Python objects alive after the last string, which is what the library holds on to.
| Parsed in a new process | Peak, dateparser | Peak, flashdate | Kept, dateparser | Kept, flashdate |
|---|---|---|---|---|
| Only the import | 28.5 | 27.3 | 5.5 | 5.8 |
| One ISO date | 32.8 | 30.0 | 8.0 | 6.0 |
| 10,000 ISO and numeric dates | 33.6 | 34.1 | 8.1 | 8.7 |
| 10,000 dates with English month names | 33.5 | 34.4 | 8.1 | 8.7 |
| 10,000 dates in French, Spanish and Russian | 35.7 | 32.7 | 9.8 | 6.0 |
| 10,000 relative dates | 33.5 | 32.7 | 8.0 | 7.2 |
| 1,000 texts that are not dates | 67.2 | 66.8 | 41.4 | 41.2 |
| 10,000 strings of every kind above | 68.9 | 68.4 | 42.4 | 41.9 |
| 50,000 strings of every kind above | 72.1 | 71.2 | 42.4 | 41.9 |
| 10,000 dates in the 205 languages | 81.7 | 96.0 | 54.6 | 67.6 |
In every case but the last, flashdate uses the memory of dateparser to within 1 MB, or less, and neither library grows with the number of strings. The jump to about 40 MB kept is dateparser's own: a string that no language reads makes both libraries load every language.
The last case is where flashdate costs memory. When dates in every language go through one process, flashdate keeps 13 MB more than dateparser, about a quarter more. It is a fixed amount, which does not grow with the number of strings. On 20,000 real article dates in many languages, measured on a laptop, the difference was 13.5 MB, and this is where it sits:
| What flashdate holds that dateparser does not | About |
|---|---|
| One compiled pattern per language, used to skip a language by its words | 5.5 MB |
| Results of analysing each pattern (which letters and words it needs) | 3.2 MB |
| Memos of recently seen words, formats and time zones | 2.5 MB |
| Word-splitting patterns in their faster form, and smaller tables | 2 MB |
These are the structures that make the strings outside the fast paths 2 to 5 times faster. The fast paths themselves cost almost no memory. Reducing this difference is planned for the next release.
To measure speed and memory on your machine, see bench/.
How it is the same
The fast paths only take a date string that they are sure to read as dateparser does, with the settings in use. Everything else is read by the code of dateparser.
Each release is compared with the unmodified dateparser it is built from: 112 million date strings in the formats of the fast paths, 836,052 results of a corpus of real and malformed strings under 31 combinations of settings, and the 248,950 article dates above. There is no difference in the date, the time zone, the period, the detected language or the error raised. The test suite of dateparser passes on CPython 3.10 to 3.14.
verification/ has the method, a script that runs the comparison on your machine in a few minutes, and the limits of these checks.
What it does not change
The supported languages, the settings, search_dates, the calendars and the
command line tool are those of dateparser. The
documentation of dateparser applies, with
flashdate as the name to import.
These are not given the fast paths and run as in dateparser, with its smaller
speed-ups: a subclass of DateDataParser, and a parser with RELATIVE_BASE,
date_formats, locales or region.
Relation to dateparser
flashdate 1.5.1.1 is built from dateparser at commit ce8c4390: version
1.5.1 and the fixes merged after it. The first commit of this
repository is the library and tests of that commit with the package renamed, so
the history after it is exactly what flashdate changes.
New formats, languages and fixes to what a date string means belong in
dateparser. flashdate takes them over when it is rebuilt from a newer version,
and its version number says which: 1.5.1.N is the Nth flashdate
release on dateparser 1.5.1.
License
BSD 3-Clause, the license of dateparser. See LICENSE and NOTICE.
Metadata
Release files for flashdate 1.5.1.1
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 |
|---|---|---|---|---|
| flashdate-1.5.1.1.tar.gz | 466.1 kB | With provenance | Details for flashdate-1.5.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flashdate-1.5.1.1-py3-none-any.whl | Python 3 | none | any | Details for flashdate-1.5.1.1-py3-none-any.whl |
Total release size: 847.0 kB
Release files / flashdate-1.5.1.1.tar.gz
| Download URL | flashdate-1.5.1.1.tar.gz |
|---|---|
| Size | 466.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0fc5913d437778ff04c60efdb8fe5e31eba7f0ec6f710484255e89f2489f9379
|
|
BLAKE2b-256 checksum How to use checksums |
44dd8c94f51ae331b1385bb737df784855330c39fb23cf02ec79931b12333e05
|
| 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 27, 2026.
Transparency logRelease files / flashdate-1.5.1.1-py3-none-any.whl
| Download URL | flashdate-1.5.1.1-py3-none-any.whl |
|---|---|
| Size | 380.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7aac4fd765a0d92562429906c5efc5a7c034ad0a4387afacc1dd1caf0e29f33a
|
|
BLAKE2b-256 checksum How to use checksums |
047ed517d713076fc334e0dbcc2327b832d669cbce4474e45728233a621c6c91
|
| 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 27, 2026.
Transparency logSecurity for flashdate 1.5.1.1
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
Both files in this release have been uploaded with provenance metadata.
Attestation for flashdate-1.5.1.1.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 27, 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.