Metadata-Version: 2.4
Name: kson2toml
Version: 1.0.1
Summary: KSON to TOML converter
Author: Matias Barrios
Author-email: matias@barrioslira.com
Description-Content-Type: text/markdown
License-File: LICENCE
Requires-Dist: kson-lang
Requires-Dist: toml
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

# KSON2TOML

LibrerÃ­a para la transformaciÃ³n de KSON a TOML.

## DescripciÃ³n

`kson2toml` es una librerÃ­a Python que permite convertir strings a formato [KSON](https://github.com/kson-org/kson) a formato [TOML](https://toml.io/) (Tom's Obvious, Minimal Language). Esta librerÃ­a utiliza el parser oficial de KSON y genera TOML vÃ¡lido y legible.

## InstalaciÃ³n

```bash
pip install kson2toml # Aun falta para su uso correcto
```

O clona este repositorio:

```bash
git clone https://github.com/Matoxx01/kson2toml.git
cd kson2toml
```

## Uso

### Uso BÃ¡sico

```python
# Uso official
```

## Ejemplo de ConversiÃ³n

### Entrada KSON:

```kson
person:
  name: 'Leonardo Bonacci'
  nickname: Fibonacci
  favorite_books:
    - title: Elements
      author: Euclid
    - title: Metaphysics
      author: Aristotle
  favorite_numbers:
    - - 0
      - 1
      - 1
      - 2
```

### Salida TOML:

```toml
name = "Leonardo Bonacci"
nickname = "Fibonacci"
favorite_books = [...]
favorite_numbers = [[0, 1, 1, 2]]
```

## API

### `kson2toml(kson_string: str) -> str`

FunciÃ³n principal que convierte un string KSON a TOML.

**ParÃ¡metros:**
- `kson_string` (str): String en formato KSON vÃ¡lido

**Retorna:**
- `str`: String en formato TOML

**Excepciones:**
- `ValueError`: Si el string KSON no es vÃ¡lido o contiene errores de sintaxis

## Estructura del Proyecto

```
kson2toml/
â”œâ”€â”€ kson2toml/
â”‚   â”œâ”€â”€ __init__.py         # Package initialization
â”‚   â”œâ”€â”€ kson2toml.py        # FunciÃ³n principal de conversiÃ³n
â”‚   â””â”€â”€ ast.py              # AST y clases para representar nodos TOML
â”œâ”€â”€ tests/
â”‚   â”œâ”€â”€ test.py             # Tests de validaciÃ³n
â”‚   â””â”€â”€ fibonacci_sequence.kson  # Archivo de ejemplo
â”œâ”€â”€ app.py                  # AplicaciÃ³n de ejemplo
â”œâ”€â”€ Pipfile                 # Dependencias del proyecto
â””â”€â”€ README.md               # Este archivo
```

## Clases AST

El mÃ³dulo `ast.py` contiene las siguientes clases para representar el Ã¡rbol de sintaxis abstracta:

- `TomlNode`: Clase base para todos los nodos
- `TomlString`: Representa strings
- `TomlInteger`: Representa enteros
- `TomlFloat`: Representa decimales
- `TomlBoolean`: Representa booleanos
- `TomlNull`: Representa valores nulos
- `TomlArray`: Representa arrays
- `TomlTable`: Representa tablas/objetos
- `TomlEmbed`: Representa bloques embebidos

## Desarrollo

### Ejecutar Tests

```bash
python tests/test.py
```

### Requisitos

- Python 3.13+
- `kson-lang`: Parser oficial de KSON
- `toml`: Parser y validador de TOML

## Licencia

Este proyecto es la librerÃ­a de conversiÃ³n KSON a TOML.

## Contribuir

Las contribuciones son bienvenidas. Por favor, asegÃºrate de que el cÃ³digo pase todos los tests antes de enviar un pull request.
