Skip to main content

TEMPORIS

An elegant Python library for managing and transforming dates and times

License Last commit PyPI Version Python Versions

🚀 Description

Temporis is a Python library designed to simplify date and time handling. It provides an elegant and functional interface to perform common date operations, manage time zones, and format dates consistently.

✨ Key Features

  • 🔄 Flexible timezone conversion
  • 📅 Advanced date operations:
    • Add and subtract hours, days, and months
    • Business day calculations
    • Quarter and semester determination
    • Holiday identification
  • 🎨 Customizable date formatting
  • ⚡ High performance and easy to use
  • 📚 Comprehensive documentation and practical examples

🛠️ Installation

pip install temporis

💡 Usage Examples

Basic Date Operations

from datetime import date, datetime
from temporis.temporis import Temporis
from temporis.format import TemporisFormat
from temporis.timezone import TemporisTz

# Create a datetime object
moment = datetime(2024, 1, 1)

# Calendar-only APIs also accept plain date objects
calendar_day = date(2024, 1, 1)

# Date manipulation
moment = Temporis.add_hours(moment, 5)           # Add 5 hours
moment = Temporis.add_days(moment, 3)            # Add 3 days
moment = Temporis.next_business_day(moment)      # Get next business day
calendar_day = Temporis.next_business_day(calendar_day)

# Timezone change
date_utc = TemporisTz.to_UTC(moment)

# Date formatting
date_str = Temporis.to_str(moment, format_str=TemporisFormat.YEAR_MONTH_DAY)
print(date_str)  # Output: 2024-01-04

Advanced Calculations

# Get next quarter
next_quarter = Temporis.next_quarter(moment)

# Check if it's a business day
is_business = Temporis.is_business_day(moment)

# Calculate difference between dates
difference = Temporis.count_days_between(date1, date2)

Supported input boundary

  • Calendar-only APIs accept both date and datetime inputs: add_days, add_months, next_business_day, previous_business_day, first_business_day_of_month, last_business_day_of_month, next_quarter, next_semester, next_year, first_day_of_month, last_day_of_month, count_days_between, is_weekend, is_holiday, and is_business_day.
  • These calendar methods preserve the caller runtime type when they return a date-like value.
  • Time arithmetic (add_seconds, add_minutes, add_hours) remains datetime-only.
  • Timezone operations from TemporisTz remain datetime-only.

📁 Project Structure

temporis/
├── src/
│   └── temporis/
│       ├── __init__.py
│       ├── temporis.py
│       ├── format.py
│       ├── references.py
│       ├── timezone.py
│       └── zones.py
├── tests/
│   ├── test_datetime.py
│   └── test_timezone.py
├── LICENSE
├── README.md
└── pyproject.toml

🤝 Contributing

Contributions are welcome. Please feel free to:

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add: AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License. See the LICENSE file for details.

📫 Contact


Developed with ❤️ by Jancel

Metadata

Release files for temporis 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for temporis 1.0.8
File Size Uploaded Provenance Actions
temporis-1.0.8.tar.gz 18.5 kB With provenance Details for temporis-1.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for temporis 1.0.8
File Interpreter ABI Platform Actions
temporis-1.0.8-py3-none-any.whl Python 3 none any Details for temporis-1.0.8-py3-none-any.whl

Total release size: 34.4 kB

Release files / temporis-1.0.8.tar.gz

Download URL temporis-1.0.8.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e1ac0f0b29d97db866d143f4aa300b3c1dce89d4ce225e2bcc1e3d9257f45b97
BLAKE2b-256 checksum
How to use checksums
ad65ed5a649fb07a201510e5595ab98067e367109d3d0ab10c52db311d322885
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 19, 2026.

Transparency log

Release files / temporis-1.0.8-py3-none-any.whl

Download URL temporis-1.0.8-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3943f4d64ca835bfad98cd17479fb1ad340b7ecc912c89ea2be87bccc6ed1f2
BLAKE2b-256 checksum
How to use checksums
b362fcb98a4b8a299950ba2ea58dfa1a8f0479ea62fe2073967e6a6e67210d37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 19, 2026.

Transparency log

Security for temporis 1.0.8

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for temporis-1.0.8.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 Oct 19, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page