An elegant Python library for managing and transforming dates and times
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.
- 🔄 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
pip install temporis
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
# 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)
temporis/
├── src/
│ └── temporis/
│ ├── __init__.py
│ ├── temporis.py
│ ├── format.py
│ └── timezone.py
├── tests/
│ ├── test_datetime.py
│ └── test_timezone.py
├── LICENSE
├── README.md
└── pyproject.toml
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
This project is licensed under the MIT License. See the LICENSE file for details.
- GitHub: @jalvarezgom
- PyPI: temporis
Developed with ❤️ by Jancel