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

Temporis is a Python library for elegantly managing and transforming dates and times.

license last-commit repo-top-language repo-top-language


Overview

Temporis is a developer tool created to help with the problem of using and managing dates in Python. Supporting the use and change of the different time uses, operate and modify dates and their formats.

Features

  • Definition and use of different time changes
  • Format for formatting dates to different str, datetime or date format
  • Performing different types of operations with a datetime
    • Add or subtract hours, days, months
    • Get the next business day, quarter, semester or year
    • Identify if a datetime is a business day, weekend or holiday
    • Get the difference between two datetime

Installation

pip install temporis

Usage

Create a new datetime object

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


# Create a new datetime object
dt = datetime(2021, 1, 1, 0, 0, 0)
# Add 5 hours to the datetime
dt = Temporis.add_hours(dt, 5)
# Add 5 days to the datetime
dt = Temporis.add_days(dt, 5)
# Minus 5 months to the datetime
dt = Temporis.add_months(dt, -5)
# Get the next business day
dt = Temporis.next_business_day(dt)
# Get the next quarter
dt = Temporis.next_quarter(dt)
# Apply UTC timezone to the datetime
dt = TemporisTz.to_UTC(dt)
# Print the datetime
print(Temporis.to_str(dt, format_str=TemporisFormat.YEAR_MONTH_DAY))

Repository Structure

└── temporis/
    ├── LICENSE
    ├── pdm.lock
    ├── pyproject.toml
    ├── README.md
    ├── src
       └── temporis
    └── tests
        ├── __init__.py
        ├── test_datetime.py
        └── test_timezone.py

License

temporis is distributed under the terms of the MIT license.

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.3.tar.gz (14.1 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.3-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: temporis-1.0.3.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.18.2 CPython/3.12.6 Linux/6.10.7-200.fc40.x86_64

File hashes

Hashes for temporis-1.0.3.tar.gz
Algorithm Hash digest
SHA256 291744e0ca82c0446c7dc6d159d80e00a66ba873893701abb55688ad692099b0
MD5 9b8a2b8fc972c5fa2f083aa0241e2811
BLAKE2b-256 a58804ee908c04b103aff9d5d4910534276ed9b77274e4ceb1bae1d7a35159a3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: temporis-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.18.2 CPython/3.12.6 Linux/6.10.7-200.fc40.x86_64

File hashes

Hashes for temporis-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e673b1a247ab3aed2672c97c1016653dac8b64429256e0ea3e669d3e61bfc537
MD5 844201d3a888ff83b5fe7d44941537f2
BLAKE2b-256 755fb984cd740021d0f9f56aad94575771dfc9ae6d789a1a734c54cf8e9eb4b5

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