Name | Eones JSON |
Version |
1.3.6
JSON |
| download |
home_page | None |
Summary | Elegant time manipulation and reasoning library |
upload_time | 2025-08-30 01:05:03 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | # MIT License
Copyright (c) 2025 Rodrigo Ezequiel Roldán
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
|
keywords |
datetime
time
calendar
library
dates
timezones
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
|
# 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
```bash
pip install "eones"
```
> If you're working with timezones on Windows or containers:
> ⚠️ Also install `tzdata`:
> ```bash
> pip install tzdata
> ```
---
## 🧪 Basic Example
```python
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` (not `pytz`)
- ✅ **Flexible parsing**: Accepts multiple date formats automatically
- ✅ **Advanced temporal operations**: Deltas, ranges and semantic comparisons
- ✅ **Modular architecture**: Clear separation between `Date`, `Delta`, `Range` and 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 |
| Date arithmetic (add/subtract) | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| Flexible parsing (string, dict, dt) | ✅ | ✅ | ✅ | ⚠️ | ✅ | ❌ |
| Coverage tested ≥ 97% | ✅ | ❓ | ❓ | ❌ | ❌ | ❌ |
| Can replace native `datetime` directly | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| Permissive license (MIT / BSD) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Actively maintained | ✅ | ✅ | ✅ | ❌ | ✅ | ⚠️ |
---
## 📚 Documentation & Examples
Comprehensive examples and documentation are available:
### 📖 Core Examples
- **[Basic Usage](https://github.com/roldriel/eones/blob/master/examples/basic_usage.md)** - Library import, date creation, formatting, basic operations
- **[Advanced Usage](https://github.com/roldriel/eones/blob/master/examples/advanced_usage.md)** - Truncation, rounding, period ranges, comparisons
- **[Complete Deltas](https://github.com/roldriel/eones/blob/master/examples/complete_deltas.md)** - Dual delta architecture, calendar vs duration intervals
- **[Use Cases](https://github.com/roldriel/eones/blob/master/examples/use_cases.md)** - Real-world examples: age calculation, billing cycles, reports
- **[Error Handling](https://github.com/roldriel/eones/blob/master/examples/error_handling.md)** - Exception hierarchy, safe date creation, validation
- **[Formatting & Serialization](https://github.com/roldriel/eones/blob/master/examples/formatting_serialization.md)** - ISO 8601, JSON export/import, API integration
### 🔗 Integration Examples
- **Django**: Custom model fields
- **SQLAlchemy**: Specialized column types
- **REST APIs**: Serialization utilities
---
## 🔧 Tests & Coverage
```bash
tox
```
```bash
coverage html && open htmlcov/index.html
```
---
## 📖 Requirements
- Python 3.9 or higher
- (Optional) `tzdata` if using timezones in systems without a local zoneinfo database
---
## 📝 License
MIT © 2025 — Rodrigo Ezequiel Roldán
[View full license](https://github.com/roldriel/eones/blob/master/LICENSE.md)
Raw data
{
"_id": null,
"home_page": null,
"name": "Eones",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "datetime, time, calendar, library, dates, timezones",
"author": null,
"author_email": "Rodrigo Ezequiel Rold\u00e1n <roldriel@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/a7/9c/26bdc57e782d3533ed07143f4cf21b372ae5ab348125d1d21a4b49ef6696/eones-1.3.6.tar.gz",
"platform": null,
"description": "# Eones\n\n\n\n\n\n\n\n---\n\n> Compatible with Python 3.9+ \u00b7 No external dependencies \u00b7 Portable and lightweight\n\n---\n\n## \u2728 What is Eones?\n\nEones 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.\n\n> *\"That is not dead which can eternal lie, and with strange aeons even death may die.\"* \n> \u2014 *Abdul Alhazred*, Necronomicon\n\n### Philosophy\n\n> **Eones is not a datetime replacement. It's a temporal reasoning layer.**\n\nEones exists to fill the gap between Python's low-level `datetime` and the need for semantic, calendar-aware date manipulation:\n\n- Using **only the standard library** (Python 3.9+)\n- Providing a **semantically rich and consistent API**\n- Supporting modern timezone-aware design with `zoneinfo`\n- Maintaining **modular and composable** architecture through clear separation of responsibilities (`Date`, `Delta`, `Range`)\n\n**Eones is for:**\n- Developers who want to reason about time semantically, not just manipulate timestamps\n- Teams that want **zero external dependencies** for maximum portability\n- Projects where **timezones, truncation, deltas and ranges** are central domain logic\n\n---\n\n## \ud83d\udce6 Installation\n\n```bash\npip install \"eones\"\n```\n\n> If you're working with timezones on Windows or containers: \n> \u26a0\ufe0f Also install `tzdata`:\n> ```bash\n> pip install tzdata\n> ```\n\n---\n\n## \ud83e\uddea Basic Example\n\n```python\nfrom eones import Eones\n\nz = Eones(\"2025-06-15\")\nz.add(months=1, days=3) # -> add 3 days and 1 month\n\nprint(z.format(\"%Y-%m-%d\")) # \u2192 2025-07-18\nprint(z.diff_for_humans(\"2025-06-10\")) # \u2192 in 5 days\nprint(z.diff_for_humans(\"2025-06-20\", locale=\"es\")) # \u2192 hace 5 d\u00edas\n```\n\n---\n\n## \ud83d\udd0d Key Features\n\n- \u2705 **Zero external dependencies**: Pure Python (Python 3.9+)\n- \u2705 **Intuitive interface**: Simple, semantically rich and easy-to-use API\n- \u2705 **Modern timezone support**: Robust handling with `zoneinfo` (not `pytz`)\n- \u2705 **Flexible parsing**: Accepts multiple date formats automatically\n- \u2705 **Advanced temporal operations**: Deltas, ranges and semantic comparisons\n- \u2705 **Modular architecture**: Clear separation between `Date`, `Delta`, `Range` and utilities\n- \u2705 **Localization**: Support for multiple languages\n- \u2705 **Humanization**: Converts time differences to readable text\n- \u2705 **Complete type hinting**: Fully typed following PEP 561\n- \u2705 **Interoperability**: Compatible with Python's standard `datetime`\n\n### Localization & Error Handling\n\nYou can add more languages by creating a new file in `eones/locales/` with the\ntranslations for your locale. For example, `fr.py` for French.\n\nEones surfaces clear exceptions derived from `EonesError`. Invalid timezones\nraise `InvalidTimezoneError`, while unparsable strings raise\n`InvalidFormatError`.\n\n---\n\n## \ud83e\uddfe Comparison with other libraries\n\n### Why not Pendulum or Arrow?\n\n| Feature | Eones | Pendulum | Arrow | Delorean | dateutil | pytz |\n|-----------------------------------------|:-----:|:--------:|:-----:|:--------:|:--------:|:----:|\n| Modern timezone support | \u2705 (`zoneinfo`) | \u274c (`pytz`) | \u274c (`pytz`) | \u2705 | \u26a0\ufe0f | \u2705 |\n| External dependencies | \u2705 None | \u274c Yes | \u274c Yes | \u274c Yes | \u274c Yes | \u274c Yes |\n| Semantically rich API | \u2705 Rich | \u2705 Medium | \u2705 Medium | \u26a0\ufe0f | \u274c | \u274c |\n| Modular/facade architecture | \u2705 Yes | \u274c No | \u274c No | \u274c No | \u274c No | \u274c No |\n| Complete type hinting & PEP 561 | \u2705 Yes | \u274c Limited | \u274c Limited | \u274c No | \u274c No | \u274c No |\n| Date arithmetic (add/subtract) | \u2705 | \u2705 | \u2705 | \u2705 | \u274c | \u274c |\n| Flexible parsing (string, dict, dt) | \u2705 | \u2705 | \u2705 | \u26a0\ufe0f | \u2705 | \u274c |\n| Coverage tested \u2265 97% | \u2705 | \u2753 | \u2753 | \u274c | \u274c | \u274c |\n| Can replace native `datetime` directly | \u2705 | \u2705 | \u2705 | \u274c | \u274c | \u274c |\n| Permissive license (MIT / BSD) | \u2705 | \u2705 | \u2705 | \u2705 | \u2705 | \u2705 |\n| Actively maintained | \u2705 | \u2705 | \u2705 | \u274c | \u2705 | \u26a0\ufe0f |\n\n---\n\n## \ud83d\udcda Documentation & Examples\n\nComprehensive examples and documentation are available:\n\n### \ud83d\udcd6 Core Examples\n- **[Basic Usage](https://github.com/roldriel/eones/blob/master/examples/basic_usage.md)** - Library import, date creation, formatting, basic operations\n- **[Advanced Usage](https://github.com/roldriel/eones/blob/master/examples/advanced_usage.md)** - Truncation, rounding, period ranges, comparisons\n- **[Complete Deltas](https://github.com/roldriel/eones/blob/master/examples/complete_deltas.md)** - Dual delta architecture, calendar vs duration intervals\n- **[Use Cases](https://github.com/roldriel/eones/blob/master/examples/use_cases.md)** - Real-world examples: age calculation, billing cycles, reports\n- **[Error Handling](https://github.com/roldriel/eones/blob/master/examples/error_handling.md)** - Exception hierarchy, safe date creation, validation\n- **[Formatting & Serialization](https://github.com/roldriel/eones/blob/master/examples/formatting_serialization.md)** - ISO 8601, JSON export/import, API integration\n\n### \ud83d\udd17 Integration Examples\n- **Django**: Custom model fields\n- **SQLAlchemy**: Specialized column types \n- **REST APIs**: Serialization utilities\n\n---\n\n## \ud83d\udd27 Tests & Coverage\n\n```bash\ntox\n```\n\n```bash\ncoverage html && open htmlcov/index.html\n```\n\n---\n\n## \ud83d\udcd6 Requirements\n\n- Python 3.9 or higher\n- (Optional) `tzdata` if using timezones in systems without a local zoneinfo database\n\n---\n\n## \ud83d\udcdd License\n\nMIT \u00a9 2025 \u2014 Rodrigo Ezequiel Rold\u00e1n \n[View full license](https://github.com/roldriel/eones/blob/master/LICENSE.md)\n",
"bugtrack_url": null,
"license": "# MIT License\n \n Copyright (c) 2025 Rodrigo Ezequiel Rold\u00e1n\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n ",
"summary": "Elegant time manipulation and reasoning library",
"version": "1.3.6",
"project_urls": {
"Bug Tracker": "https://github.com/roldriel/eones/issues",
"documentation": "https://roldriel.github.io/eones/",
"repository": "https://github.com/roldriel/eones"
},
"split_keywords": [
"datetime",
" time",
" calendar",
" library",
" dates",
" timezones"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9a665d0585aa37423079770f376f953d5314ced1408424b9294649ae0836c253",
"md5": "6b6fe4ab8c68ebdff1eb696a6149967e",
"sha256": "394531478a7ffc959d4d9ce46fce5ddfdcdc1e0175ea639384522cc31844bdcc"
},
"downloads": -1,
"filename": "eones-1.3.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6b6fe4ab8c68ebdff1eb696a6149967e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 30529,
"upload_time": "2025-08-30T01:05:02",
"upload_time_iso_8601": "2025-08-30T01:05:02.412200Z",
"url": "https://files.pythonhosted.org/packages/9a/66/5d0585aa37423079770f376f953d5314ced1408424b9294649ae0836c253/eones-1.3.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a79c26bdc57e782d3533ed07143f4cf21b372ae5ab348125d1d21a4b49ef6696",
"md5": "2c4b6c854eb9463ccf242559d80cb8c0",
"sha256": "995cfe3a196f0a043bc47120fb00ca818a14dd9a95aba35088c30fc91b1308f9"
},
"downloads": -1,
"filename": "eones-1.3.6.tar.gz",
"has_sig": false,
"md5_digest": "2c4b6c854eb9463ccf242559d80cb8c0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 54363,
"upload_time": "2025-08-30T01:05:03",
"upload_time_iso_8601": "2025-08-30T01:05:03.678422Z",
"url": "https://files.pythonhosted.org/packages/a7/9c/26bdc57e782d3533ed07143f4cf21b372ae5ab348125d1d21a4b49ef6696/eones-1.3.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-30 01:05:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "roldriel",
"github_project": "eones",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "eones"
}