Registry / type-stubs / types-dateparser

types-dateparser

JSON →
library1.4.2.20260813pypypi✓ verified 24d ago

types-dateparser is a type stub package that provides external type annotations for the `dateparser` library. It enables static type checkers (like MyPy or Pyright) to analyze code using `dateparser` for type correctness without affecting runtime behavior. The current version, `1.4.0.20260408`, indicates it aims to provide accurate annotations for `dateparser~=1.4.0`, with the last part reflecting the typeshed release date. Updates are frequent, often daily, reflecting typeshed's continuous integration and bug fixes.

pip install types-dateparser
INSTALL
IMPORT
SIG · TYPES-DATEPARSER
T
types-dateparser
type-stubspythonv1.4.2.20260813
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.4.2.20260813 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parse
from dateparser_stubs import parse
from dateparser_stubs import parse

This quickstart demonstrates the typical usage of the `dateparser` library, which is enhanced by the `types-dateparser` stubs for static type checking. The stubs themselves are not directly used in the runtime code.

import dateparser from datetime import datetime # types-dateparser provides type hints for the dateparser library. # It is not imported directly for runtime functionality. date_string = "today" parsed_date: datetime | None = dateparser.parse(date_string) if parsed_date: print(f"Parsed '{date_string}': {parsed_date}") else: print(f"Could not parse '{date_string}'") # Example with a specific format and language setting french_date_string = "20 Février 2023" parsed_french_date: datetime | None = dateparser.parse( french_date_string, languages=['fr'] ) if parsed_french_date: print(f"Parsed '{french_french_date_string}' (French): {parsed_french_date}")
Debug
Known issues
gotchaDo not attempt to import symbols directly from `types_dateparser`. This package is purely for static type analysis and does not contain runtime code. Importing from it will result in `ModuleNotFoundError` or incorrect behavior.
fix
Always import from the `dateparser` package for runtime functionality: `import dateparser` or `from dateparser import parse`.
affects: All versions
gotchaEnsure the `X.Y.Z` part of `types-dateparser`'s version aligns with the installed version of `dateparser`. For example, `types-dateparser==1.4.0.YYYYMMDD` is intended for `dateparser~=1.4.0`. Mismatched versions can lead to inaccurate type checking results, where the stubs describe an API different from your installed runtime library.
fix
Pin the `types-dateparser` version to match your `dateparser` dependency's major/minor/patch versions (e.g., `pip install 'dateparser==1.4.0' 'types-dateparser==1.4.0.*'`).
affects: All versions
gotchaExplicitly configuring `MYPYPATH` or similar environment variables for `types-dateparser` is usually unnecessary. Modern type checkers automatically discover installed stub packages in your Python environment. Manual configuration can sometimes lead to issues if paths are incorrect or conflict with automatic discovery.
fix
Rely on your type checker's automatic stub discovery mechanism. Only use explicit path configurations if you are developing stubs or facing specific advanced scenarios.
affects: All versions
breakingAs `types-dateparser` reflects the API of `dateparser`, major or even minor breaking changes in `dateparser`'s API will eventually be mirrored in the stubs. This may cause type-checking errors in your project even if `dateparser`'s runtime code still functions due to its internal backward compatibility mechanisms.
fix
Review `dateparser`'s release notes for breaking changes and update your code and type annotations accordingly. Update `types-dateparser` in conjunction with `dateparser` to maintain type accuracy.
affects: Between major versions of `dateparser` (e.g., `dateparser` 1.x to 2.x), and sometimes minor versions.
Upgrade
Version history
1.4.2.20260813latest on PyPI · released Aug 13, 2026
Audit
Dependencies
dateparserrequiredThis package provides typing stubs for the `dateparser` runtime library; `dateparser` must be installed for these stubs to be useful.
Agent activity
32 hits · last 30 days
node
28
OpenAI (training)
1
Resources
types-dateparser — pip install types-dateparser · libregistry