Skip to main content

🎯 Tenty Parser

Tenty Parser es una herramienta CLI moderna para parsear, transformar y convertir entre diferentes formatos de datos estructurados: JSON, YAML y TOON (Token-Oriented Object Notation).

Python License PyPI

✨ Características

  • 🔍 Parse múltiples formatos: JSON, YAML, TOON
  • 🌳 Visualización en árbol de estructuras de datos
  • 📊 Generación de schemas: JSON Schema y OpenAPI
  • 🔄 Conversión entre formatos con un solo comando
  • 🎨 Salida colorida con Rich
  • Optimizado para LLMs con formato TOON (30-60% reducción de tokens)

📦 Instalación

Requisitos previos

  • Python 3.12+

Con pip (uso normal)

pip install tenty-parser

Esto deja disponible el comando tenty directamente en tu shell — no hace falta clonar el repositorio ni usar python -m para nada:

tenty --help

Si estás desarrollando el proyecto en sí (no solo usándolo), ve a Desarrollo más abajo para instalar desde el código fuente con uv.

🚀 Uso

Comandos principales

1. Parse - Analizar archivos

# Visualizar estructura en árbol
tenty parse data.json

# Mostrar como JSON estructurado
tenty parse data.json --format json

# Generar schema
tenty parse data.json --format schema

# Convertir a TOON
tenty parse data.json --format toon

# Guardar resultado
tenty parse data.json --format toon -o output.toon

2. Convert - Convertir entre formatos

# JSON a TOON
tenty convert input.json output.toon --to toon

# YAML a JSON
tenty convert config.yaml config.json --to json

# JSON a YAML
tenty convert data.json data.yaml --to yaml

# TOON a JSON
tenty convert data.toon data.json --to json

3. Schema - Generar schemas

# Generar JSON Schema
tenty schema data.json -o schema.json

# Generar OpenAPI Schema
tenty schema data.json --format openapi -o openapi.json

# Con título personalizado
tenty schema data.json --title "User API Schema"

4. Version - Ver versión

tenty version

📖 Formato TOON

TOON (Token-Oriented Object Notation) es un formato optimizado para modelos de lenguaje que reduce el uso de tokens en 30-60%.

Características de TOON

  • Arrays con tamaño explícito: users[2]:
  • Formato tabular para objetos: users[2]{id,name,role}:
  • Indentación en lugar de llaves
  • Sin comillas innecesarias

Ejemplo de conversión

JSON original:

{
  "user": {
    "name": "John Doe",
    "age": 30,
    "tags": ["developer", "python", "rust"]
  },
  "posts": [
    {
      "id": 1,
      "title": "Hello World",
      "published": true
    }
  ]
}

TOON equivalente:

user:
  name: "John Doe"
  age: 30
  tags[3]: developer, python, rust
posts[1]{id,title,published}:
  1,"Hello World",true

Reducción de tokens: ~45% menos tokens que JSON

🏗️ Estructura del proyecto

tenty-parser/
├── tenty_parser/
│   ├── models/
│   │   └── structure.py          # Modelos Pydantic
│   ├── parsers/
│   │   ├── json_parser.py        # Parser JSON
│   │   ├── yaml_parser.py        # Parser YAML
│   │   └── toon_parser.py        # Parser TOON
│   ├── transformers/
│   │   ├── to_structure.py       # Transformador a estructura
│   │   ├── to_toon.py           # Transformador a TOON
│   │   └── to_schema.py         # Generador de schemas
│   └── cli.py                    # Interfaz CLI
├── tests/                        # Suite de tests (pytest, cobertura mínima 90%)
├── docs/
│   ├── functionality.md          # Arquitectura y comandos del CLI
│   ├── deployment.md             # Flujo de release y publicación a PyPI
│   ├── dependency-research.md    # Hand-written vs. librerías mantenidas
│   └── testing.md                # Ejemplos reales de entrada/salida por comando
├── pyproject.toml               # Configuración del proyecto
├── README.md                    # Este archivo
├── LICENSE                      # Licencia personalizada
└── .gitignore                   # Archivos ignorados

Documentación detallada: docs/functionality.md y docs/deployment.md.

🔧 Desarrollo

Si vas a modificar el código del proyecto (no solo usarlo), instala desde el código fuente con uv:

# Clonar repositorio
git clone https://github.com/Keniding/tenty-parser.git
cd tenty-parser

# Instalar en modo desarrollo (crea el venv e instala el comando `tenty` en él)
uv sync

# Ejecutar el CLI desde el código fuente
uv run tenty --help

# Ejecutar tests con cobertura
uv run pytest --cov=tenty_parser --cov-report=term-missing

Agregar nuevas características

  1. Fork el proyecto
  2. Crea una rama: git checkout -b feature/nueva-caracteristica
  3. Commit cambios: git commit -am 'Agregar nueva característica'
  4. Push a la rama: git push origin feature/nueva-caracteristica
  5. Crea un Pull Request

📚 Ejemplos

Ejemplo 1: Analizar API Response

# Descargar respuesta de API
curl https://api.example.com/users > users.json

# Visualizar estructura
tenty parse users.json

# Generar schema para documentación
tenty schema users.json -o users-schema.json

# Convertir a TOON para usar con LLMs
tenty convert users.json users.toon --to toon

Ejemplo 2: Convertir configuración

# Convertir YAML a JSON
tenty convert config.yaml config.json --to json

# Ver estructura
tenty parse config.json --format tree

Ejemplo 3: Workflow completo

# 1. Parse archivo original
tenty parse data.json --format tree

# 2. Generar schema
tenty schema data.json -o schema.json

# 3. Convertir a TOON para LLM
tenty convert data.json data.toon --to toon

# 4. Convertir de vuelta a JSON
tenty convert data.toon data-restored.json --to json

🎯 Casos de uso

Para desarrolladores

  • 📝 Generar schemas automáticamente desde ejemplos
  • 🔄 Convertir entre formatos de configuración
  • 🔍 Explorar estructuras de datos complejas
  • 📊 Documentar APIs

Para trabajar con LLMs

  • ⚡ Reducir tokens en prompts (formato TOON)
  • 📦 Estructurar datos de forma eficiente
  • 🎯 Mejorar comprensión de estructuras por LLMs

Para análisis de datos

  • 🌳 Visualizar jerarquías de datos
  • 📋 Validar estructuras
  • 🔄 Normalizar formatos

🤝 Contribuir

¡Las contribuciones son bienvenidas! Por favor:

  1. Lee las guías de contribución
  2. Abre un issue para discutir cambios grandes
  3. Escribe tests para nuevas características
  4. Mantén el estilo de código consistente

Nota: Al contribuir, aceptas que tus contribuciones se licencien bajo los mismos términos que este proyecto.

📄 Licencia

Este proyecto está bajo una Licencia Personalizada con los siguientes términos:

✅ Uso Personal y No Comercial

  • LIBRE: Puedes usar, modificar y distribuir el software gratuitamente
  • Requisito: Debes dar crédito al autor original (Keniding)

⚠️ Uso Comercial

  • REQUIERE AUTORIZACIÓN: Contacta para obtener una licencia comercial
  • Incluye: Compensación acordada y/o reconocimiento

📝 Reconocimiento Obligatorio

En cualquier uso del software, debes incluir:

Powered by Tenty Parser - Created by Keniding
https://github.com/Keniding/tenty-parser

Para más detalles, consulta el archivo LICENSE.

Para licencias comerciales, contacta a través de:

🙏 Agradecimientos

📞 Contacto

🗺️ Roadmap

  • Tests unitarios completos
  • Parser TOON más robusto
  • Soporte para más formatos (XML, TOML)
  • Validación de schemas
  • API Python para uso programático
  • Plugins para editores (VSCode)
  • Documentación interactiva

⭐ Si te gusta este proyecto, dale una estrella en GitHub!


Powered by Tenty Parser - Created by Keniding

Release files for tenty-parser 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tenty-parser 0.1.3
File Size Uploaded
tenty_parser-0.1.3.tar.gz 55.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tenty-parser 0.1.3
File Interpreter ABI Platform
tenty_parser-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 71.0 kB

Release files / tenty_parser-0.1.3.tar.gz

Download URL tenty_parser-0.1.3.tar.gz
Size 55.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f0d6993d8cd80c26fa39d36b9a0a3810c7791b574a47b4b05f695b2ec54ccc58
BLAKE2b-256 checksum
How to use checksums
abcccefc81b742f75a2e9f0fb80326664c2d1258dbec70f9a207e95eaee08649
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.

Transparency log

Release files / tenty_parser-0.1.3-py3-none-any.whl

Download URL tenty_parser-0.1.3-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ecf4e0090b63fa8722b24fdaa4752f7621aa4e380cfa8464c7194046b0d612d
BLAKE2b-256 checksum
How to use checksums
61bc5a21f1f8e81025fbd61b159f945dff18472d7327aa21e34b70b2cb608994
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page