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
๐ 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:
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add: AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
๐ License
This project is licensed under the MIT License. See the LICENSE file for details.
๐ซ Contact
- GitHub: @jalvarezgom
- PyPI: temporis
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file temporis-1.0.6.tar.gz.
File metadata
- Download URL: temporis-1.0.6.tar.gz
- Upload date:
- Size: 16.3 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1b656c40a2b389656d31ff9117a2962f0a53a2a4b6e827aeb736e6357d5dcb7
|
|
| MD5 |
e410a73104e411b47031727467151ba6
|
|
| BLAKE2b-256 |
efb32e5f6a5aa905f895520dddafda89afcd41ff3933b135b28fa6f4180f752a
|
File details
Details for the file temporis-1.0.6-py3-none-any.whl.
File metadata
- Download URL: temporis-1.0.6-py3-none-any.whl
- Upload date:
- Size: 15.0 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e49e2325400441d32d94d1cfeb8b1655895556664823877fd97529e2903d3301
|
|
| MD5 |
845fdcd9ef7028fade4a89d6c1fe72e6
|
|
| BLAKE2b-256 |
70b51e0a78a4cd7de7b4bb63e6d31a8daad32bbc6262d0fd1e390219af3d68c6
|