Skip to content

Commit bc12e9a

Browse files
author
Rodrigo Roldán
committed
docs: update main Readme and spanish readme
1 parent 4c4058e commit bc12e9a

2 files changed

Lines changed: 115 additions & 56 deletions

File tree

README.es.md

Lines changed: 65 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# Eones
22
![Python](https://img.shields.io/badge/Python-3.9+-yellow?style=for-the-badge&logo=python)
3-
![License](https://img.shields.io/badge/License-MIT-yellow?style=for-the-badge)
4-
![Build](https://img.shields.io/badge/Build-manual-green?style=for-the-badge)
5-
![Coverage](https://img.shields.io/badge/Coverage-97%25-blue?style=for-the-badge)
6-
![Tox](https://img.shields.io/badge/Tested%20with-tox-yellowgreen?style=for-the-badge)
73
![PyPI](https://img.shields.io/pypi/v/eones?style=for-the-badge)
8-
![ChatGPT](https://img.shields.io/badge/ChatGPT-Collaborator-lightgrey?style=for-the-badge&logo=openai)
4+
![Pylint](https://img.shields.io/badge/pylint-10.00-green?style=for-the-badge)
5+
![Coverage](https://img.shields.io/badge/Coverage-100%25-red?style=for-the-badge)
6+
![Build](https://img.shields.io/badge/Build-manual-green?style=for-the-badge)
7+
![Tox](https://img.shields.io/badge/Tested%20tox-yellowgreen?style=for-the-badge)
98

109
---
1110

@@ -17,9 +16,25 @@
1716

1817
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.
1918

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."*
2120
> *Abdul Alhazred*, Necronomicón
2221
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+
2338
---
2439

2540
## 📦 Instalación
@@ -42,7 +57,7 @@ pip install "eones"
4257
from eones import Eones
4358
4459
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
4661
4762
print(z.format("%Y-%m-%d")) # → 2025-07-18
4863
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
5368

5469
## 🔍 Características principales
5570

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
71+
-**Sin dependencias externas**: Python puro (Python 3.9+)
72+
-**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
6583

6684
Podés agregar más idiomas creando un archivo en `eones/locales/` con las
6785
traducciones para tu idioma. Por ejemplo, `fr.py` para francés.
6886

69-
Manejo de errores
70-
7187
Eones muestra excepciones claras derivadas de `EonesError`. Las zonas horarias no válidas generan `InvalidTimezoneError`, mientras que las cadenas no analizables generan `InvalidFormatError`.
7288

7389
---
7490

7591
## 🧾 Comparación con otras librerías
7692

77-
| Característica | Eones | Pendulum | Arrow | Delorean | dateutil | pytz |
78-
|-------------------------------------------|:-----:|:--------:|:-----:|:--------:|:--------:|:----:|
79-
| API moderna y consistente |||| ⚠️ |||
80-
| Manipulación de fechas (add/subtract) |||||||
81-
| Parsing flexible (string, dict, datetime) |||| ⚠️ |||
82-
| Soporte nativo de zonas horarias ||||| ⚠️ ||
83-
| Sin dependencias externas |||||||
84-
| Testeada con coverage ≥ 97% |||||||
85-
| Apta para reemplazar `datetime` directo |||||||
86-
| Licencia permisiva (MIT / BSD) |||||||
87-
| Mantenimiento activo |||||| ⚠️ |
93+
### ¿Por qué no Pendulum o Arrow?
94+
95+
| Característica | Eones | Pendulum | Arrow | Delorean | dateutil | pytz |
96+
|-----------------------------------------|:-----:|:--------:|:-----:|:--------:|:--------:|:----:|
97+
| Soporte moderno de zonas horarias | ✅ (`zoneinfo`) | ❌ (`pytz`) | ❌ (`pytz`) || ⚠️ ||
98+
| Dependencias externas | ✅ Ninguna | ❌ Sí | ❌ Sí | ❌ Sí | ❌ Sí | ❌ Sí |
99+
| API semánticamente rica | ✅ Rica | ✅ Media | ✅ Media | ⚠️ |||
100+
| Arquitectura modular/facade | ✅ Sí | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No |
101+
| Type hinting completo y PEP 561 | ✅ Sí | ❌ Limitado | ❌ Limitado | ❌ No | ❌ No | ❌ No |
102+
| Aritmética de fechas (suma/resta) |||||||
103+
| Parsing flexible (string, dict, dt) |||| ⚠️ |||
104+
| Testeada con coverage ≥ 97% |||||||
105+
| Puede reemplazar `datetime` nativo |||||||
106+
| Licencia permisiva (MIT / BSD) |||||||
107+
| Mantenimiento activo |||||| ⚠️ |
88108

89109
---
90110

91-
## 📚 Ejemplos avanzados
111+
## 📚 Documentación y Ejemplos
112+
113+
Ejemplos completos y documentación disponibles:
92114

93-
Podés encontrar más ejemplos en:
115+
### 📖 Ejemplos Principales
116+
- **[Uso Básico](examples/es/uso_basico.md)** - Importación de librería, creación de fechas, formateo, operaciones básicas
117+
- **[Uso Avanzado](examples/es/uso_avanzado.md)** - Truncamiento, redondeo, rangos de períodos, comparaciones
118+
- **[Deltas Completos](examples/es/deltas_completo.md)** - Arquitectura dual de deltas, intervalos de calendario vs duración
119+
- **[Casos de Uso](examples/es/casos_de_uso.md)** - Ejemplos del mundo real: cálculo de edad, ciclos de facturación, reportes
120+
- **[Manejo de Errores](examples/es/manejo_errores.md)** - Jerarquía de excepciones, creación segura de fechas, validación
121+
- **[Formateo y Serialización](examples/es/formateo_serializacion.md)** - ISO 8601, exportación/importación JSON, integración con APIs
94122

95-
- [examples/basic_usage.py](examples/basic_usage.py)
96-
- [examples/advanced_usage.py](examples/advanced_usage.py)
97-
- [examples/labor_calendar.py](examples/labor_calendar.py)
123+
### 🔗 Ejemplos de Integración
124+
- **Django**: Campos personalizados para modelos
125+
- **SQLAlchemy**: Tipos de columna especializados
126+
- **APIs REST**: Utilidades de serialización
98127

99128
---
100129

@@ -113,11 +142,11 @@ coverage html && open htmlcov/index.html
113142
## 📖 Requisitos
114143

115144
- Python 3.9 o superior
116-
- (Opcional) `tzdata` si usás zonas horarias en sistemas sin base local
145+
- (Opcional) `tzdata` si usás zonas horarias en sistemas sin base local de zoneinfo
117146

118147
---
119148

120149
## 📝 Licencia
121150

122151
MIT © 2025 — Rodrigo Ezequiel Roldán
123-
[Ver licencia completa](LICENSE.md)
152+
[Ver licencia completa](https://github.com/roldriel/eones/blob/master/LICENSE.md)

README.md

Lines changed: 50 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,25 @@
1616

1717
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.
1818

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."*
2020
> *Abdul Alhazred*, Necronomicon
2121
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+
2238
---
2339

2440
## 📦 Installation
@@ -52,21 +68,22 @@ print(z.diff_for_humans("2025-06-20", locale="es")) # → hace 5 días
5268

5369
## 🔍 Key Features
5470

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
73+
-**Modern timezone support**: Robust handling with `zoneinfo` (not `pytz`)
74+
-**Flexible parsing**: Accepts multiple date formats automatically
75+
-**Advanced temporal operations**: Deltas, ranges and semantic comparisons
76+
-**Modular architecture**: Clear separation between `Date`, `Delta`, `Range` and utilities
77+
-**Localization**: Support for multiple languages
78+
-**Humanization**: Converts time differences to readable text
79+
-**Complete type hinting**: Fully typed following PEP 561
80+
-**Interoperability**: Compatible with Python's standard `datetime`
81+
82+
### Localization & Error Handling
6483

6584
You can add more languages by creating a new file in `eones/locales/` with the
6685
translations for your locale. For example, `fr.py` for French.
6786

68-
Error Handling
69-
7087
Eones surfaces clear exceptions derived from `EonesError`. Invalid timezones
7188
raise `InvalidTimezoneError`, while unparsable strings raise
7289
`InvalidFormatError`.
@@ -75,27 +92,40 @@ raise `InvalidTimezoneError`, while unparsable strings raise
7592

7693
## 🧾 Comparison with other libraries
7794

95+
### Why not Pendulum or Arrow?
96+
7897
| Feature | Eones | Pendulum | Arrow | Delorean | dateutil | pytz |
7998
|-----------------------------------------|:-----:|:--------:|:-----:|:--------:|:--------:|:----:|
80-
| Modern, consistent API |||| ⚠️ |||
99+
| Modern timezone support | ✅ (`zoneinfo`) | ❌ (`pytz`) | ❌ (`pytz`) || ⚠️ ||
100+
| External dependencies | ✅ None | ❌ Yes | ❌ Yes | ❌ Yes | ❌ Yes | ❌ Yes |
101+
| Semantically rich API | ✅ Rich | ✅ Medium | ✅ Medium | ⚠️ |||
102+
| Modular/facade architecture | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No | ❌ No |
103+
| Complete type hinting & PEP 561 | ✅ Yes | ❌ Limited | ❌ Limited | ❌ No | ❌ No | ❌ No |
81104
| Date arithmetic (add/subtract) |||||||
82105
| Flexible parsing (string, dict, dt) |||| ⚠️ |||
83-
| Native timezone support ||||| ⚠️ ||
84-
| No external dependencies |||||||
85106
| Coverage tested ≥ 97% |||||||
86107
| Can replace native `datetime` directly |||||||
87108
| Permissive license (MIT / BSD) |||||||
88109
| Actively maintained |||||| ⚠️ |
89110

90111
---
91112

92-
## 📚 Advanced Examples
113+
## 📚 Documentation & Examples
114+
115+
Comprehensive examples and documentation are available:
93116

94-
You can find more usage examples in:
117+
### 📖 Core Examples
118+
- **[Basic Usage](examples/basic_usage.md)** - Library import, date creation, formatting, basic operations
119+
- **[Advanced Usage](examples/advanced_usage.md)** - Truncation, rounding, period ranges, comparisons
120+
- **[Complete Deltas](examples/complete_deltas.md)** - Dual delta architecture, calendar vs duration intervals
121+
- **[Use Cases](examples/use_cases.md)** - Real-world examples: age calculation, billing cycles, reports
122+
- **[Error Handling](examples/error_handling.md)** - Exception hierarchy, safe date creation, validation
123+
- **[Formatting & Serialization](examples/formatting_serialization.md)** - ISO 8601, JSON export/import, API integration
95124

96-
- [examples/basic_usage.py](https://github.com/roldriel/eones/blob/master/examples/basic_usage.py)
97-
- [examples/advanced_usage.py](https://github.com/roldriel/eones/blob/master/examples/advanced_usage.py)
98-
- [examples/labor_calendar.py](https://github.com/roldriel/eones/blob/master/examples/labor_calendar.py)
125+
### 🔗 Integration Examples
126+
- **Django**: Custom model fields
127+
- **SQLAlchemy**: Specialized column types
128+
- **REST APIs**: Serialization utilities
99129

100130
---
101131

0 commit comments

Comments
 (0)