prefixdate
Parse and process date string of varied precision as prefixes in Python.
Decision gist · record as of 2026-08-14
Yes. Prefixdate solves a specific, real problem—handling dates with incomplete precision—cleanly and with zero dependencies. It is actively maintained, licensed permissively, supports current Python versions, and has no known vulnerabilities. Install it if your application needs to parse or normalize dates where only partial information is available; skip it if you only work with complete dates.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.11 or newer.
- Installs cleanly with no runtime dependencies.
- Actively maintained with a recent release; last commit was 2026-08-08 and the project is not archived.
License · maintenance · safety
MIT (permissive) — MIT license permits use, modification, and distribution with minimal restrictions, making it suitable for both open and proprietary projects.
last release 2026-08-08 (6 days) · last repo commit 2026-08-08 · 14 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 914,009 downloads/mo, #4,736 on PyPI
Alternatives
Verify before relying
pip install prefixdate
from prefixdate import parse, normalize_date, Precision
date = parse('2001-3')
print(date.text) # '2001-03'
print(date.precision) # Precision.MONTH
normalized = normalize_date('2001-1')
print(normalized) # '2001-01'- Whether the library handles leap-year edge cases or other calendar complexities beyond what the caveats mention.
- Performance characteristics when parsing large batches of dates or with many custom format strings.
What it is and what it does
Prefixdate is a lightweight date parser for handling dates where only partial information is known—a year alone, a year and month, or a full date. It normalizes these partial dates into a consistent format and tracks the precision level (year, month, day, or finer) so your application knows what was actually specified. The library accepts strings in ISO 8601-like format (e.g., '2001', '2001-4', '2001-04-02'), integers, datetime objects, or custom format strings via strptime patterns, and returns a structured DatePrefix object with both the normalized text representation and precision metadata.
The package is designed for contexts where sources report dates with varying completeness—common in historical records, metadata, or user-supplied information. It does not implement the full complexity of ISO 8601 or RFC 3339 (no date ranges, no week notation), focusing instead on the practical case of partial dates. It has no external dependencies and runs on Python 3.11 and newer.
Use it for
- Normalize dates from historical datasets where only year or year-month is known, preserving precision information.
- Parse user-supplied dates in custom formats and standardize them to ISO 8601-like strings for storage.
- Validate and re-format partial dates in metadata systems that track date confidence.
- Handle datetime objects with custom precision truncation (e.g., round to minute or hour level).
- Accept dates in multiple formats and produce consistent normalized output.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Prefixdate solves a specific, real problem—handling dates with incomplete precision—cleanly and with zero dependencies. It is actively maintained, licensed permissively, supports current Python versions, and has no known vulnerabilities. Install it if your application needs to parse or normalize dates where only partial information is available; skip it if you only work with complete dates.
Install
prefixdate on PyPI
Before you install
Installs cleanly with no runtime dependencies. Actively maintained with a recent release; last commit was 2026-08-08 and the project is not archived.
Requires Python 3.11 or newer.
License in practice
MIT license permits use, modification, and distribution with minimal restrictions, making it suitable for both open and proprietary projects.
Quickstart
pip install prefixdate
from prefixdate import parse, normalize_date, Precision
date = parse('2001-3')
print(date.text) # '2001-03'
print(date.precision) # Precision.MONTH
normalized = normalize_date('2001-1')
print(normalized) # '2001-01'
Verify before relying
- Whether the library handles leap-year edge cases or other calendar complexities beyond what the caveats mention.
- Performance characteristics when parsing large batches of dates or with many custom format strings.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 6 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 914,009 / month, #4,736 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: prefixdate-0.6.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “partial date parsing”
- prefixdateParses date strings with partial precision (year, month, or day) into…
- iso8601Parses ISO 8601 date strings (e.g. 2007-01-14T20:34:22+00:00) into…
- recognizers-text-date-timeRecognizes and resolves date and time entities from text in multiple…
Give your agent the search over MCP, or paste the wish link into any chat.
More Text Processing packages
A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.
pyparsing provides a library for building text parsers directly in Python code using composable grammar classes, handling quoted strings, whitespace variation, and embedded comments without regex or lex/yacc.
Install it if you need to parse text or define grammars programmatically.
fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.
Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
RapidFuzz provides fast fuzzy string matching using Levenshtein Distance and related metrics, implemented mostly in C++ with Python bindings for rapid similarity scoring and approximate string matching.
Install it if you need fuzzy string matching; it's a solid replacement for FuzzyWuzzy with better licensing and performance.
tinycss2 parses CSS strings into token and block objects, and generates CSS strings from those objects, following the CSS Syntax Level 3 specification without enforcing specific properties or values.
Install it if your project requires CSS tokenization or syntax manipulation.
See also iso8601 · dateparser · isodate · dateformat · arrow · python-dateutil · aniso8601 · metomi-isodatetime · tonyg-rfc3339 · rfc3339