Install & Compatibility
Where this runs
tested against v2025.11.30 · 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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.014s · 17.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.016s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Date
✓ from datetype import Date
✗ from datetime import date (DateType wraps but is incompatible)
datetype.Date is not the same as datetime.date; they are incompatible by design.
DateTime
✓ from datetype import DateTime
✗ from datetime import datetime
datetype.DateTime is not substitutable for datetime.datetime.
NaiveDateTime
✓ from datetype import NaiveDateTime
✗ from datetype import DateTime (NaiveDateTime is distinct from DateTime)
DateTime requires aware (tz-aware) instances; use NaiveDateTime for naive.
AwareDateTime
✓ from datetype import AwareDateTime
✗ from datetype import DateTime
AwareDateTime is an alias for DateTime; both require tz-aware.
Create strict date and datetime objects that are not interchangeable with stdlib types.
from datetype import Date, DateTime, NaiveDateTime, AwareDateTime
from datetime import timezone, timedelta
# Date: no time, no timezone
d = Date(2024, 12, 25)
print(d) # 2024-12-25
# NaiveDateTime: no timezone
ndt = NaiveDateTime(2024, 12, 25, 10, 30)
print(ndt) # 2024-12-25 10:30:00
# AwareDateTime: requires tzinfo
tz = timezone(timedelta(hours=5))
adt = AwareDateTime(2024, 12, 25, 10, 30, tzinfo=tz)
print(adt) # 2024-12-25 10:30:00+05:00
# Note: DateTime is same as AwareDateTime
from datetype import DateTime as DT
assert DT is AwareDateTime
Errors
Common errors & fixes
TypeError: NaiveDateTime instance is not aware
Trying to pass a NaiveDateTime where an AwareDateTime (or DateTime) is expected.
fixEither make the datetime aware by adding a tzinfo, or use NaiveDateTime explicitly in the type annotation.
AttributeError: 'Date' object has no attribute 'hour'
Date objects do not have time components. Attempted to access time attribute on a Date.
fixUse DateTime or NaiveDateTime if you need time components.
TypeError: cannot compare datetime.date with datetype.Date
Mixing stdlib and DateType types in comparisons.
fixConvert one type to the other using .to_stdlib() or .from_stdlib() before comparing.
Upgrade
Version history
2025.11.30latest on PyPI · released Dec 1, 2025
Audit
Dependencies
typing-extensionsoptionalUsed for type hints like Literal on older Python versions