Skip to main content

KSON to TOML converter

Project description

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 a formato TOML (Tom's Obvious, Minimal Language). Esta librería utiliza el parser oficial de KSON y genera TOML válido y legible.

Instalación

pip install kson2toml

O clona este repositorio:

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

Uso

Aplicación Gráfica

Instala el paquete:

pip install kson2toml

Luego ejecuta:

kson2toml

Uso en Código

from kson2toml import kson2toml

resultado = kson2toml(string_kson)

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

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

python tests/test.py

Requisitos

  • Python 3.13+
  • kson-lang: Parser oficial de KSON
  • toml: Parser y validador de 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kson2toml-1.0.5.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kson2toml-1.0.5-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file kson2toml-1.0.5.tar.gz.

File metadata

  • Download URL: kson2toml-1.0.5.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kson2toml-1.0.5.tar.gz
Algorithm Hash digest
SHA256 bd66dac3e238ae1e552ff8c3ff3bb688a4705deba741f076e736f133ba97b959
MD5 b2587a00756ea775f37b6597537becb2
BLAKE2b-256 7b0b2344145fc05a92ee7a32bde86e2806df02c031df01cc2f6a113804a32cf2

See more details on using hashes here.

File details

Details for the file kson2toml-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: kson2toml-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kson2toml-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0ac5345fce1e801004066e1deabf745845d3376d6d26fd93929c8da62d8d8014
MD5 2dbb1dde9d123518db00c2c791bd79c7
BLAKE2b-256 5cc81ddda4652fcfa9df8cf5d25ad4427aa2676d469753ca56653d442c3746c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page