Skip to main content

Temporis is a Python library for elegantly managing and transforming dates and times. It provides intuitive tools for handling temporal data, making time calculations, conversions, and formatting simple and efficient.

Project description

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 datetime
from temporis.temporis import Temporis
from temporis.format import TemporisFormat
from temporis.timezone import TemporisTz

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

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

# Timezone change
date_utc = TemporisTz.to_UTC(date)

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

Advanced Calculations

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

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

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

๐Ÿ“ Project Structure

temporis/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ temporis/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ temporis.py
โ”‚       โ”œโ”€โ”€ format.py
โ”‚       โ””โ”€โ”€ timezone.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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

temporis-1.0.7.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

temporis-1.0.7-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file temporis-1.0.7.tar.gz.

File metadata

  • Download URL: temporis-1.0.7.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.22.3 CPython/3.13.2 Linux/6.12.15-200.fc41.x86_64

File hashes

Hashes for temporis-1.0.7.tar.gz
Algorithm Hash digest
SHA256 eb735d32a71aa2cc5545849b66fdf43ec45442a7cdd35767dbc890e1f3d886a5
MD5 67114bf216c91aca5c0a9faf22f76316
BLAKE2b-256 4e268485614d5073083afcc500254d7f96419bf00d1abb8beb335f8a18673865

See more details on using hashes here.

File details

Details for the file temporis-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: temporis-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.22.3 CPython/3.13.2 Linux/6.12.15-200.fc41.x86_64

File hashes

Hashes for temporis-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a3d907cb5f5d5ad56adc9d498f644b4530bff2c45229dac19bf5dc1f9a24fca2
MD5 fe7ad99348e022a3970e269508c0a8ac
BLAKE2b-256 70d816216a4744e3f6499bade85f2bb560ab2ad3861436a177011401278a426d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page