dateparsa
Date parsing for input whose format you do not control.
CSV imports, log lines, third-party APIs, user-typed strings: dateparsa works out the format, parses the value, and tells you when it had to guess. It reads 32 structured formats, Unix timestamps by their digit count, dates written around a month name in 20 languages, and natural language ("next friday at 5pm"). It never reads a clock: an input that needs a base time is an error unless you pass one.
pip install dateparsa
Wheels for Linux (glibc and musl), macOS 13+ and Windows, on x86_64 and arm64, for Python 3.9 and later. No dependencies, and nothing to compile.
import dateparsa
r = dateparsa.parse("March 15, 2024")
r.datetime # datetime(2024, 3, 15, 0, 0, tzinfo=timezone.utc)
r.label # 'MONTH_DAY_YEAR'
# Ambiguity is reported, never hidden.
dateparsa.parse("01/02/2024").ambiguous # True: January 2nd was a guess
dateparsa.parse("01/02/2024", prefer_day_first=True) # February 1st
try:
dateparsa.parse("01/02/2024", strict=True)
except dateparsa.Ambiguous as e:
e.interpretations # the MM/DD/YYYY and DD/MM/YYYY readings
# A column settles what one value cannot.
column = ["01/02/2024", "05/06/2024", "13/02/2024"]
report = dateparsa.detect_column(column)
report.order # 'day_first', settled by row 2
[dateparsa.parse(v, **report.preferences) for v in column] # each read day first
# A whole column in one call, each value as parse reads it.
col = dateparsa.parse_column(["2024-03-15", "N/A", "2024-03-17T10:30:00Z"])
col.failed # [1]
col.datetimes() # [datetime(2024, 3, 15, ...), None, datetime(...)]
# Hand the format to pandas, Go or Java.
dateparsa.parse("13/02/2024 10:30").layout.format_string() # '%d/%m/%Y %H:%M'
# Natural language and other languages, against a base time you choose.
from datetime import datetime, timezone
dateparsa.parse("vor 3 Tagen", base_time=datetime(2024, 3, 15, tzinfo=timezone.utc), locales=["de"])
parse takes keyword options: base_time, timezone_offset,
prefer_day_first, prefer_year_first, prefer_future, strict and
locales. A failed parse raises NoMatch, Ambiguous or NoBaseTime, all
ValueErrors. Parser reads a column, reusing the first value's layout, and
Layout.parse reads a value with no detection at all. parse_column reads a
whole column in one call into the library, several times as fast as one call
a value: datetimes(), times() and failed on what it returns, and
datetime64() for a numpy array pandas takes, with NaT where a value did not
parse (numpy is not a dependency).
This package is a thin ctypes binding to libdateparsa, the C interface of the
Zig library dateparsa.zig, whose
README has the full format table and how its answers are checked: they match
the Go original on 158,631 inputs. Apache-2.0; the locale data is derived from
the Unicode CLDR under the Unicode License v3 (see NOTICE).
Metadata
Release files for dateparsa 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 696.0 kB
Release files / dateparsa-0.4.0-py3-none-win_arm64.whl
| Download URL | dateparsa-0.4.0-py3-none-win_arm64.whl |
|---|---|
| Size | 110.9 kB |
| Tags | Python 3 Windows ARM64 |
|
SHA-256 checksum How to use checksums |
eb8d644cf71257aa18d593015c1313e64e6de8768e4ad3e05947c86075824359
|
|
BLAKE2b-256 checksum How to use checksums |
180d52d6c4d0ab295bf404c7df163bfbb044ae6ff5aa40fd74dd67c7ffaa8eef
|
| 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 Oct 29, 2026.
Transparency logRelease files / dateparsa-0.4.0-py3-none-win_amd64.whl
| Download URL | dateparsa-0.4.0-py3-none-win_amd64.whl |
|---|---|
| Size | 143.9 kB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
eb51cdd205fa042016a72f4179be71e4eb3893a8f96488d9ec3b808f08321262
|
|
BLAKE2b-256 checksum How to use checksums |
70bfc752ef3c2b9823c95fd59ca50828baebae4c22094ff515f3b879ecb64cb2
|
| 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 Oct 29, 2026.
Transparency logRelease files / dateparsa-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl
| Download URL | dateparsa-0.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64.whl |
|---|---|
| Size | 114.9 kB |
| Tags | Linux glibc 2.17+ x86-64 Linux musl 1.1+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
1628281f8b3cd57655bb21e6425bb10fb3e25d9917e116fee54de10388904eff
|
|
BLAKE2b-256 checksum How to use checksums |
2b471030a8017fc3b3182fd2d4aefa9d322bc1783ee6dc84ab702655531252c8
|
| 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 Oct 29, 2026.
Transparency logRelease files / dateparsa-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
| Download URL | dateparsa-0.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl |
|---|---|
| Size | 116.4 kB |
| Tags | Linux glibc 2.17+ ARM64 Linux musl 1.1+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
c68bf2ddef4c14bacb556ac47575da6a328bc5ddc712934b7ce0643a49c75c31
|
|
BLAKE2b-256 checksum How to use checksums |
53366868c75b15755cdf51097fd475c6616bee121060eed86abd01421ac66bf1
|
| 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 Oct 29, 2026.
Transparency logRelease files / dateparsa-0.4.0-py3-none-macosx_13_0_x86_64.whl
| Download URL | dateparsa-0.4.0-py3-none-macosx_13_0_x86_64.whl |
|---|---|
| Size | 103.5 kB |
| Tags | Python 3 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
d106f5e35ecdb05614a573f2f2b7a0f7f914fa406c8e052c3c991eca7a8bdf7c
|
|
BLAKE2b-256 checksum How to use checksums |
aec1fae2189cd166db1553def4ba5abf98f9a4767273a7501341a115acfa4fe5
|
| 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 Oct 29, 2026.
Transparency logRelease files / dateparsa-0.4.0-py3-none-macosx_13_0_arm64.whl
| Download URL | dateparsa-0.4.0-py3-none-macosx_13_0_arm64.whl |
|---|---|
| Size | 106.4 kB |
| Tags | Python 3 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
da389b353e0c0e67f9f5500e3ca83345cdda90266ba9f4cfe2f6dfe7468e4343
|
|
BLAKE2b-256 checksum How to use checksums |
e6b93a5b1966c8f9a36f693e87e857119067cd888b4affc35a13423f8f74b5c0
|
| 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 Oct 29, 2026.
Transparency logSecurity for dateparsa 0.4.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 6 files in this release have been uploaded with provenance metadata.
Attestation for dateparsa-0.4.0-py3-none-win_arm64.whl
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 29, 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.