skillfed

datetime-quarter

Simple and lightweight quarter support for python datetime

datetime-quarter v1.0.3 149.3K downloads/30d#10,995 on PyPI12
Permissive license Abandoned released

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-quarter

uv

uv add datetime-quarter

poetry

poetry add datetime-quarter

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3

Tags

quarter date handlingfiscal quarter supportdatetime quarter operationsquarterly date rangecalendar quarter arithmeticquarter-based date mathpython quarter dates
datetimefiscal-reporting

More Software Development packages