FixDateIt
| Category | Status' and Links |
|---|---|
| General | |
| CD/CI | |
| PyPI | |
| Github |
Overview
FixDateIt is a Python library designed to intelligently correct and normalize date strings into a standard format. It handles various common date formats, separators, and even attempts to fix common data entry errors.
Key Features
- Format Normalization: Converts various input date formats (e.g., YMD, DMY) into a consistent output format (defaulting to
%Y%m%d). - Flexible Separators: Automatically handles different separators like
/,-, and.. - Heuristic Corrections:
- Century Guessing: Automatically adds the correct century (1900s or 2000s) for two-digit years.
- Day/Month Swapping: Detects and fixes cases where day and month might have been swapped (e.g., if month > 12).
- Out-of-range Day Correction: Can optionally cap days to the maximum valid day for a given month (e.g., setting Feb 30th to Feb 28th/29th).
- Numeric String Parsing: Handles compact numeric strings (e.g., "20230101" or "010123") by intelligently inserting separators before parsing.
- Month Name Support: Recognizes three-letter month abbreviations (e.g., "JAN", "FEB").
Basic Usage
from fixdate import FixDate
# Basic conversion
fd = FixDate("01-15-2023", p_in_format="MDY")
print(fd.date_str) # Output: 20230115
# Fixing swapped day/month
fd = FixDate("31/12/2023", p_in_format="MDY")
print(fd.date_str) # Output: 20231231
# Handling abbreviations
fd = FixDate("15-JAN-23", p_in_format="DMY")
print(fd.date_str) # Output: 20230115
Metadata
Release files for FixDate 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fixdate-2.1.0.tar.gz | 5.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fixdate-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.0 kB
Release files / fixdate-2.1.0.tar.gz
| Download URL | fixdate-2.1.0.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13232f1450b9d67277b4565ea39142e54f9a7da64f303f96a63aa533e911acc1
|
|
BLAKE2b-256 checksum How to use checksums |
2805a1c8c2b5e37966b27403f1155be378975c7cc8bbebe046f06dbb0cd85910
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.13.11 Linux/6.11.0-1018-azure
|
Release files / fixdate-2.1.0-py3-none-any.whl
| Download URL | fixdate-2.1.0-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6a02d05092e1a1f15158aa3202c523e954401cc09ce1db086637b61342a913a
|
|
BLAKE2b-256 checksum How to use checksums |
76d43dcbde225336895c690c8367726fe43af5c8969f6c761ab2ab0dad5fb6a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.13.11 Linux/6.11.0-1018-azure
|