Metadata-Version: 2.3
Name: pytabify
Version: 1.0.1
Summary: pytabify es una librería de propósito general para la manipulación, transformación y análisis de datos tabulares obtenidos a través de diversos formatos de archivo (CSV, JSON, Excel, etc.). Ofrece una API intuitiva y flexible que permite crear, validar y persistir estructuras de datos (DataTables), facilitando su integración en proyectos de automatización de pruebas, scripts y aplicaciones de análisis de datos.
License: MIT License
         
         Copyright (c) 2025 Angel Gerardo Molina Valdez
         
         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.
Author: Angel Gerardo Molina Valdez
Author-email: angelgerardomolinavaldez@gmail.com
Requires-Python: >=3.9
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: jsonschema (>=4.23.0,<5.0.0)
Requires-Dist: openpyxl (>=3.1.5,<4.0.0)
Project-URL: Repository, https://github.com/angel-valdezzz/pytabify
Description-Content-Type: text/markdown

## 📌 pytabify

**📊 Tabify your data, Python-style**  

*📊 Tabula tus datos con magia Python*

**pytabify** es una librería de propósito general para la manipulación, transformación y análisis de datos tabulares obtenidos a través de diversos formatos de archivo (**CSV, JSON, Excel**). Ofrece una API intuitiva y flexible que permite crear, validar y persistir estructuras de datos (**DataTables**), facilitando su integración en proyectos de **automatización de pruebas**, **scripts** y **aplicaciones de análisis de datos**.

---

## 🚀 Características

✅ **Soporte para múltiples formatos:** Importa datos desde archivos CSV, JSON y Excel.  
✅ **Estructura tabular flexible:** Manipula datos con un enfoque basado en filas y columnas.  
✅ **Validación de datos integrada:** Usa JSON Schema para garantizar la calidad de los datos.  
✅ **Fácil integración con frameworks de pruebas:** Compatible con **Robot Framework, unittest, pytest, etc.**  
✅ **Exportación flexible:** Guarda los datos en distintos formatos según sea necesario.  

---

## 📦 Instalación

### Usando pip:
```sh
pip install pytabify
```

---

## 📖 Uso Básico

### 📌 Creando un DataTable desde un archivo
```python
from pytabify import DataTableCreator

# Desde CSV
datatable = DataTableCreator.from_file("data.csv")

# Desde JSON
datatable = DataTableCreator.from_file("data.json")

# Desde Excel (requiere indicar la hoja)
datatable = DataTableCreator.from_file("data.xlsx", sheet_name="Hoja1")
```

### 📌 Accediendo a los datos
```python
# Obtener una fila específica
row = datatable[0]  
print(row.first_name.value)

# Iterar sobre filas
for row in datatable:
    print(row.to_dict())

# Modificar valores
row.new_field = "Nuevo Valor"
row["edad"] = 25
```

### 📌 Guardando datos
```python
from pytabify import DataTableSaver

# Guardar en CSV
DataTableSaver.into_csv(datatable, "output.csv")

# Guardar en JSON
DataTableSaver.into_json(datatable, "output.json")

# Guardar en Excel
DataTableSaver.into_xlsx(datatable, "output.xlsx")
```

---

## 🛠️ Integración con Pruebas Automatizadas

**pytabify** está diseñado para funcionar en entornos de **pruebas automatizadas**.  
Ejemplo de uso en **Robot Framework**:

```robot
*** Settings ***
Library    pytabify.DataTableCreator     AS    DataTableCreator
Library    pytabify.DataTableSaver       AS    DataTableSaver

*** Test Cases ***
Leer datos desde CSV
    ${datatable}=    DataTableCreator.From File    path=data.csv
    Should Not Be Empty    ${datatable}

Validar un campo específico
    ${row}=    Get From List    ${datatable}    0
    Should Be Equal As Strings    ${row.first_name}    "Alice"

Guardar datos en Excel
    DataTableSaver.Into Xlsx    ${datatable}    path=output.xlsx
    File Should Exist    output.xlsx
```

---

## 🧪 Pruebas

Para ejecutar los tests unitarios:

```sh
poetry run pytest -s .\utests\test_pytabify.py
```

---

## 📜 Licencia

Este proyecto está bajo la licencia **MIT**. Consulta el archivo `LICENSE` para más detalles.

---
