Elegant time manipulation and reasoning library
Project description
Eones
Compatible with Python 3.9+ · No external dependencies · Portable and lightweight
✨ What is Eones?
Eones is a minimalist, dependency-free library for expressive, clear, and powerful date/time manipulation. Inspired by natural language semantics, it allows you to manipulate, compare, and transform dates as if they were living entities.
"That is not dead which can eternal lie, and with strange aeons even death may die."
— Abdul Alhazred, Necronomicon
Philosophy
Eones is not a datetime replacement. It's a temporal reasoning layer.
Eones exists to fill the gap between Python's low-level datetime and the need for semantic, calendar-aware date manipulation:
- Using only the standard library (Python 3.9+)
- Providing a semantically rich and consistent API
- Supporting modern timezone-aware design with
zoneinfo - Maintaining modular and composable architecture through clear separation of responsibilities (
Date,Delta,Range)
Eones is for:
- Developers who want to reason about time semantically, not just manipulate timestamps
- Teams that want zero external dependencies for maximum portability
- Projects where timezones, truncation, deltas and ranges are central domain logic
📦 Installation
pip install "eones"
If you're working with timezones on Windows or containers:
⚠️ Also installtzdata:pip install tzdata
🧪 Basic Example
from eones import Eones
z = Eones("2025-06-15")
z.add(months=1, days=3) # -> add 3 days and 1 month
print(z.format("%Y-%m-%d")) # → 2025-07-18
print(z.diff_for_humans("2025-06-10")) # → in 5 days
print(z.diff_for_humans("2025-06-20", locale="es")) # → hace 5 días
🔍 Key Features
- ✅ Zero external dependencies: Pure Python (Python 3.9+)
- ✅ Intuitive interface: Simple, semantically rich and easy-to-use API
- ✅ Modern timezone support: Robust handling with
zoneinfo(notpytz) - ✅ Flexible parsing: Accepts multiple date formats automatically, including ISO 8601 with timezone offsets
- ✅ Advanced temporal operations: Deltas, ranges and semantic comparisons
- ✅ Modular architecture: Clear separation between
Date,Delta,Rangeand utilities - ✅ Localization: Support for multiple languages
- ✅ Humanization: Converts time differences to readable text
- ✅ Complete type hinting: Fully typed following PEP 561
- ✅ Interoperability: Compatible with Python's standard
datetime
Localization & Error Handling
You can add more languages by creating a new file in eones/locales/ with the
translations for your locale. For example, fr.py for French.
Eones surfaces clear exceptions derived from EonesError. Invalid timezones
raise InvalidTimezoneError, while unparsable strings raise
InvalidFormatError.
🧾 Comparison with other libraries
Why not Pendulum or Arrow?
| Feature | Eones | Pendulum | Arrow | Delorean | dateutil | pytz |
|---|---|---|---|---|---|---|
| Modern timezone support | ✅ (zoneinfo) |
❌ (pytz) |
❌ (pytz) |
✅ | ⚠️ | ✅ |
| External dependencies | ✅ None | ❌ Yes | ❌ Yes | ❌ Yes | ❌ Yes | ❌ Yes |
| Semantically rich API | ✅ Rich | ✅ Medium | ✅ Medium | ⚠️ | ❌ | ❌ |
| Modular/facade architecture | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No |
| Complete type hinting & PEP 561 | ✅ Yes | ❌ Limited | ❌ Limited | ❌ No | ❌ No | ❌ No |
| High Performance (~1M ops/sec) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No |
Memory Optimized (__slots__) |
✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No |
| Zero-dep Localization (No Babel) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No |
| Dedicated Range/Period API | ✅ Yes | ✅ Yes | ⚠️ Basic | ⚠️ Basic | ❌ No | ❌ No |
| Date arithmetic (add/subtract) | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| Flexible parsing (string, dict, dt) | ✅ | ✅ | ✅ | ⚠️ | ✅ | ❌ |
| Coverage tested ≥ 97% | ✅ | ❓ | ❓ | ❌ | ❌ | ❌ |
Can replace native datetime directly |
✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| Permissive license (MIT / BSD) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Actively maintained | ✅ | ✅ | ✅ | ❌ | ✅ | ⚠️ |
See the numbers yourself: For detailed performance metrics (Speed, Memory, Profiling), check out our Benchmark Suite.
📚 Documentation & Examples
Comprehensive examples and documentation are available:
📖 Core Examples
- Basic Usage - Library import, date creation, formatting, basic operations
- Advanced Usage - Truncation, rounding, period ranges, comparisons
- Complete Deltas - Dual delta architecture, calendar vs duration intervals
- Use Cases - Real-world examples: age calculation, billing cycles, reports
- Error Handling - Exception hierarchy, safe date creation, validation
- Formatting & Serialization - ISO 8601, JSON export/import, API integration
- Week Configuration - First day of week configuration, ISO vs US standards, weekend detection
🔗 Integration Examples
- Django: Custom model fields
- SQLAlchemy: Specialized column types
- REST APIs: Serialization utilities
🔧 Tests & Coverage
tox
coverage html && open htmlcov/index.html
📖 Requirements
- Python 3.9 or higher
- (Optional)
tzdataif using timezones in systems without a local zoneinfo database
📝 License
MIT © 2025 — Rodrigo Ezequiel Roldán
View full license
Project details
Release history Release notifications | RSS feed
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 eones-1.4.0.tar.gz.
File metadata
- Download URL: eones-1.4.0.tar.gz
- Upload date:
- Size: 70.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48cfd90d869cef3b46d3af6454ce631ddbd7c403c8a0cac268f9be37410d68fa
|
|
| MD5 |
fe7e0b264d2c66718260287b890e1044
|
|
| BLAKE2b-256 |
6fc295a9d9b83df4a056218f09edc861a6dd4cd255aa25c642bc40a30d10240f
|
Provenance
The following attestation bundles were made for eones-1.4.0.tar.gz:
Publisher:
release.yml on roldriel/eones
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eones-1.4.0.tar.gz -
Subject digest:
48cfd90d869cef3b46d3af6454ce631ddbd7c403c8a0cac268f9be37410d68fa - Sigstore transparency entry: 812259075
- Sigstore integration time:
-
Permalink:
roldriel/eones@191012c161a89bdf79e8f29a8fa2216791019670 -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/roldriel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@191012c161a89bdf79e8f29a8fa2216791019670 -
Trigger Event:
push
-
Statement type:
File details
Details for the file eones-1.4.0-py3-none-any.whl.
File metadata
- Download URL: eones-1.4.0-py3-none-any.whl
- Upload date:
- Size: 34.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83598b3c03f3ba9e6757aa9f923519f07f85235f75058ddd155c3e8b6a79bb6e
|
|
| MD5 |
a37c9787b5b311c8cd2ba63bf0969327
|
|
| BLAKE2b-256 |
0b0e5d715803b188000a20feefd661233b834a53d5590afeb81d61e313ab00d6
|
Provenance
The following attestation bundles were made for eones-1.4.0-py3-none-any.whl:
Publisher:
release.yml on roldriel/eones
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eones-1.4.0-py3-none-any.whl -
Subject digest:
83598b3c03f3ba9e6757aa9f923519f07f85235f75058ddd155c3e8b6a79bb6e - Sigstore transparency entry: 812259095
- Sigstore integration time:
-
Permalink:
roldriel/eones@191012c161a89bdf79e8f29a8fa2216791019670 -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/roldriel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@191012c161a89bdf79e8f29a8fa2216791019670 -
Trigger Event:
push
-
Statement type: