datetime-quarter
Simple and lightweight quarter support for python datetime
What it is and what it does
datetime-quarter wraps Python's standard datetime.date with a DateQuarter class that treats fiscal or calendar quarters as discrete, comparable units. Instead of working with individual dates or month ranges, you create a quarter object (e.g., DateQuarter(2019, 4) for Q4 2019), then add, subtract, compare, or iterate over it. The package handles quarter arithmetic, distance calculations between quarters, membership tests, and range iteration.
The package has no runtime dependencies and installs as pure Python, making it lightweight. However, it has been abandoned since its initial release in 2020 with no subsequent updates, bug fixes, or maintenance. It remains functional for straightforward quarter operations but carries the risk of incompatibility with future Python versions or edge cases that may not have been discovered or addressed.
Use it for:
- Build financial reporting systems that organize data and metrics by fiscal quarter rather than by month or year.
- Generate quarterly date ranges for filtering historical data or defining reporting periods in analytics pipelines.
- Perform quarter-over-quarter comparisons by adding or subtracting quarters to shift analysis windows forward or backward.
- Validate whether a given date falls within a specific quarter for business logic or data validation rules.
- Iterate over all quarters within a date range to generate quarterly summaries or reports.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds quarter-based date handling to Python's datetime module, letting you create, compare, and iterate over fiscal or calendar quarters as first-class objects.
Yes, if you need lightweight quarter arithmetic and your project is stable. The package is simple, dependency-free, and works for its stated purpose. However, the abandoned status means no future bug fixes or Python version support—evaluate whether you can maintain a fork or accept the risk of eventual incompatibility. For new projects with long-term support requirements, consider whether a more actively maintained alternative or a custom implementation would be safer.
Install
datetime-quarter on PyPI
pip
pip install datetime-quarteruv
uv add datetime-quarterpoetry
poetry add datetime-quarterInstalling datetime-quarter
Before you install
Low install friction—pure Python, no runtime dependencies. However, the package is abandoned; last release was 2020-02-09 and no updates have been made since. Use only if the existing feature set meets your needs and you're comfortable maintaining a fork if issues arise.
License in practice
MIT license (permissive); you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install datetime-quarter
from datetime import date
from datetime_quarter import DateQuarter
q = DateQuarter(2019, 4)
print(q) # 2019 4Q
print(q.start_date())
print(q.end_date())
Verify before relying
- Whether the package works correctly with modern Python versions given its abandoned status and lack of recent testing.
- Whether quarter numbering follows ISO 8601 or a different standard, and whether it handles fiscal years with non-standard quarter boundaries.
- The correct import path for the DateQuarter class (fact sheet shows usage but not the exact module name).
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,378 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 149,317/month — #10,995 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: datetime_quarter-1.0.3-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
fiscalyearProvides fiscal year, quarter, month, and day…
permissive · top 15,000 on PyPI
datedeltadatedelta extends Python's datetime module with…
permissive · top 15,000 on PyPI
cftimeConverts between calendar dates and numeric…
permissive · top 5,000 on PyPI
lunardateConverts between Gregorian (solar) and Chinese…
copyleft · top 5,000 on PyPI
chinese-calendarDetermines whether a specific date in China is…
permissive · top 15,000 on PyPI
dateutilsProvides date and time arithmetic operations,…
permissive · top 5,000 on PyPI
LunarCalendarConverts between lunar and solar calendar…
permissive · top 15,000 on PyPI
nc-time-axisEnables matplotlib to plot data using cftime…
permissive · top 15,000 on PyPI
zhdateConverts between Chinese lunar calendar dates…
copyleft · top 15,000 on PyPI
tkcalendarProvides Calendar and DateEntry widgets for…
copyleft · top 15,000 on PyPI