TimeCore
A modern, unified, fully typed Python library for date and time
Date, time, duration, intervals, calendars, recurrence, and scheduling
under one consistent, strongly typed API.
Documentation · Capabilities · Installation · Usage · Contributing
Capabilities
| Family | Covers |
|---|---|
| Core types | Date, Time, LocalDateTime, DateTime, Instant, TimeZone, Weekday; immutable value objects, DST-aware arithmetic, native interop |
| Durations & periods | Duration for exact lengths of time, Period for calendar-based amounts |
| Intervals | Interval and IntervalSet; half-open by default, set operations |
| Calendars & business time | Calendar, HolidayCalendar, BusinessCalendar; holidays, business days and hours |
| Recurrence & cron | Recurrence rules with iCalendar interchange, Cron expressions |
| Schedules & availability | Schedule combining rules with times, timezones and calendars; Availability free/busy time |
| Parsing | Strict ISO 8601 parsing, custom formats, optional natural-language parsing |
| Formatting & localization | Locale-aware formatting of temporal values and durations |
| Clocks & timers | Injectable Clock for deterministic tests, Timer for elapsed time |
Installation
TimeCore supports Python 3.12 and newer.
Add it to a uv project:
uv add timecore
To install it in an active Python environment:
pip install timecore
To build from source:
git clone https://github.com/oceanus403/timecore
cd timecore
uv sync --locked
Usage
from timecore import (
BusinessCalendar,
Date,
DateTime,
Duration,
Interval,
Period,
Recurrence,
Schedule,
Time,
Weekday,
parse_date,
)
# Dates and calendar arithmetic.
today = Date(2026, 11, 25)
next_month = today + Period(months=1) # 2026-12-25
ten_days = today + Duration(days=10) # 2026-12-05
# A zoned datetime; DST is handled, never guessed.
meeting = DateTime(2026, 11, 25, 9, 0, timezone="America/New_York")
instant = meeting.to_instant() # 2026-11-25T14:00:00Z
# A half-open interval and a weekly schedule.
week = Interval(today, today + Duration(days=7))
schedule = Schedule(
Recurrence.weekly([Weekday.MONDAY, Weekday.FRIDAY]),
time=Time(9, 0),
timezone="America/New_York",
calendar=BusinessCalendar(country="US"),
)
occurrences = schedule.occurrences(today, count=3)
# Strict parsing and locale-aware formatting.
deadline = parse_date("2026-12-25")
print(deadline.format()) # Dec 25, 2026
print(deadline.format(locale="fr_FR")) # 25 déc. 2026
Project status
TimeCore 0.1.0 is released. The API may change before 1.0.
License
MIT. See LICENSE.
Metadata
Release files for timecore 0.2.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 | Provenance | Actions |
|---|---|---|---|---|
| timecore-0.2.0.tar.gz | 67.4 kB | With provenance | Details for timecore-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| timecore-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for timecore-0.2.0-py3-none-any.whl |
Total release size: 156.7 kB
Release files / timecore-0.2.0.tar.gz
| Download URL | timecore-0.2.0.tar.gz |
|---|---|
| Size | 67.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21b421d0c8b61b05c22bd8abcf9ffda453e44044d290c0c703418d3526613b82
|
|
BLAKE2b-256 checksum How to use checksums |
bbf01132b79d21575e36f79ef352abe6f451858573d2515a9738c78d1db3e88f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / timecore-0.2.0-py3-none-any.whl
| Download URL | timecore-0.2.0-py3-none-any.whl |
|---|---|
| Size | 89.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
24da4a2e0082d41373b536728f2278043e1656dd4b4c4dc7c36cf713dd5c1eef
|
|
BLAKE2b-256 checksum How to use checksums |
0abb4542247d04b8ee35a688dcab963d318dc5fac0199f3d605c3074715403a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for timecore 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for timecore-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.