You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Eones es una librería minimalista, sin dependencias externas, para trabajar con fechas y operaciones de tiempo de manera expresiva, clara y poderosa. Inspirada en la semántica natural del lenguaje, permite manipular, comparar y transformar fechas como si fueran entidades vivas.
19
18
20
-
> *“No está muerto lo que yace eternamente, y con el paso de extraños eones, incluso la muerte puede morir.”*
19
+
> *"No está muerto lo que yace eternamente, y con el paso de extraños eones, incluso la muerte puede morir."*
21
20
> — *Abdul Alhazred*, Necronomicón
22
21
22
+
### Filosofía
23
+
24
+
> **Eones no es un reemplazo de datetime. Es una capa de razonamiento temporal.**
25
+
26
+
Eones existe para llenar el vacío entre el `datetime` de bajo nivel de Python y la necesidad de manipulación de fechas semántica y consciente del calendario:
27
+
28
+
- Usando **solo la librería estándar** (Python 3.9+)
29
+
- Proporcionando una **API semánticamente rica y consistente**
30
+
- Soportando diseño moderno y consciente de zonas horarias con `zoneinfo`
31
+
- Manteniéndose **modular y componible** a través de separación clara de responsabilidades (`Date`, `Delta`, `Range`)
32
+
33
+
**Eones es para:**
34
+
- Desarrolladores que quieren razonar sobre el tiempo semánticamente, no solo manipular timestamps
35
+
- Equipos que quieren **cero dependencias externas** para máxima portabilidad
36
+
- Proyectos donde **zonas horarias, truncamiento, deltas y rangos** son lógica de dominio central
37
+
23
38
---
24
39
25
40
## 📦 Instalación
@@ -42,7 +57,7 @@ pip install "eones"
42
57
from eones import Eones
43
58
44
59
z = Eones("2025-06-15")
45
-
z.add(months=1, days=3) # -> agregar 3 dias and 1 mes
60
+
z.add(months=1, days=3) # -> agregar 3 días y 1 mes
46
61
47
62
print(z.format("%Y-%m-%d")) # → 2025-07-18
48
63
print(z.diff_for_humans("2025-06-10")) # → en 5 días
@@ -53,48 +68,62 @@ print(z.diff_for_humans("2025-06-20", locale="es")) # → hace 5 días
53
68
54
69
## 🔍 Características principales
55
70
56
-
- ✅ Parsers automáticos para `str`, `dict`, `datetime`, `Eones`
57
-
- ✅ Agregado de días, meses, años, minutos y segundos
58
-
- ✅ Comparación de fechas (misma semana, dentro del año, entre rangos)
59
-
- ✅ Rango de día / semana / mes / trimestre / año completo
60
-
- ✅ Truncamiento y redondeo por unidad
61
-
- ✅ Soporte completo para `ZoneInfo` (PEP 615)
62
-
- ✅ Sin dependencias externas
63
-
- ✅ Conversión a `datetime`, `date`, y tipos nativos
64
-
- ✅ Diferencias expresivas con `diff_for_humans` y soporte de idiomas
- ✅ **Interfaz intuitiva**: API simple, semánticamente rica y fácil de usar
73
+
- ✅ **Soporte moderno de zonas horarias**: Manejo robusto con `zoneinfo` (no `pytz`)
74
+
- ✅ **Parsing flexible**: Acepta múltiples formatos de fecha automáticamente
75
+
- ✅ **Operaciones temporales avanzadas**: Deltas, rangos y comparaciones semánticas
76
+
- ✅ **Arquitectura modular**: Separación clara entre `Date`, `Delta`, `Range` y utilidades
77
+
- ✅ **Localización**: Soporte para múltiples idiomas
78
+
- ✅ **Humanización**: Convierte diferencias de tiempo a texto legible
79
+
- ✅ **Type hinting completo**: Totalmente tipado siguiendo PEP 561
80
+
- ✅ **Interoperabilidad**: Compatible con `datetime` estándar de Python
81
+
82
+
### Localización y Manejo de Errores
65
83
66
84
Podés agregar más idiomas creando un archivo en `eones/locales/` con las
67
85
traducciones para tu idioma. Por ejemplo, `fr.py` para francés.
68
86
69
-
Manejo de errores
70
-
71
87
Eones muestra excepciones claras derivadas de `EonesError`. Las zonas horarias no válidas generan `InvalidTimezoneError`, mientras que las cadenas no analizables generan `InvalidFormatError`.
Copy file name to clipboardExpand all lines: README.md
+50-20Lines changed: 50 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,25 @@
16
16
17
17
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.
18
18
19
-
> *“That is not dead which can eternal lie, and with strange aeons even death may die.”*
19
+
> *"That is not dead which can eternal lie, and with strange aeons even death may die."*
20
20
> — *Abdul Alhazred*, Necronomicon
21
21
22
+
### Philosophy
23
+
24
+
> **Eones is not a datetime replacement. It's a temporal reasoning layer.**
25
+
26
+
Eones exists to fill the gap between Python's low-level `datetime` and the need for semantic, calendar-aware date manipulation:
27
+
28
+
- Using **only the standard library** (Python 3.9+)
29
+
- Providing a **semantically rich and consistent API**
30
+
- Supporting modern timezone-aware design with `zoneinfo`
31
+
- Maintaining **modular and composable** architecture through clear separation of responsibilities (`Date`, `Delta`, `Range`)
32
+
33
+
**Eones is for:**
34
+
- Developers who want to reason about time semantically, not just manipulate timestamps
35
+
- Teams that want **zero external dependencies** for maximum portability
36
+
- Projects where **timezones, truncation, deltas and ranges** are central domain logic
37
+
22
38
---
23
39
24
40
## 📦 Installation
@@ -52,21 +68,22 @@ print(z.diff_for_humans("2025-06-20", locale="es")) # → hace 5 días
52
68
53
69
## 🔍 Key Features
54
70
55
-
- ✅ Automatic parsing for `str`, `dict`, `datetime`, `Eones`
56
-
- ✅ Add/subtract days, months, years, minutes, seconds
57
-
- ✅ Date comparison (same week, within year, between ranges)
58
-
- ✅ Full day/week/month/quarter/year ranges
59
-
- ✅ Truncation and rounding by unit
60
-
- ✅ Full support for `ZoneInfo` (PEP 615)
61
-
- ✅ Zero external dependencies
62
-
- ✅ Conversion to `datetime`, `date`, and native types
63
-
- ✅ Human-friendly differences via `diff_for_humans` with locale support
71
+
- ✅ **Zero external dependencies**: Pure Python (Python 3.9+)
72
+
- ✅ **Intuitive interface**: Simple, semantically rich and easy-to-use API
0 commit comments