Helper library to parse Toon files.
Project description
Toon Escape Parser
Lightweight helper library designed to convert complex, nested JSON structures into a clean, human-readable TOON text format. This format is optimized for concise representation and rapid human parsing of structured data.
Features
- Flexible Input: Accepts file paths to JSON files, raw JSON strings, or already-parsed Python dictionaries.
- Intelligent Formatting: Automatically detects and formats uniform lists of dictionaries (like player rosters or item lists) into a compact toon-style output.
- Strict Adherence: Follows the Python packaging standards using Hatchling.
Installation
From PyPI (Recommended)
To install the latest stable version of toon-escape:
pip install toon-escape
The project exposes a console entry point configured in pyproject.toml (script name: toonparser).
Usage
Programmatic:
# python
from ToonEscape.ToonParser import ToonParser
parser = ToonParser()
# json_data can be a file path, a dict, or a JSON string
result = parser.parseToon({
"name": "Example",
"teams": [{"id": 1, "name": "Alpha"}, {"id": 2, "name": "Beta"}]
})
print(result)
Refer to the implementation in ToonEscape.ToonParser.ToonParser.parseToon for details on accepted inputs and output formatting.
CLI
After installation, the console script toonparser (configured in pyproject.toml) can be used if the package is installed as a wheel or editable install. Behavior and arguments mirror the library's input types (file path / JSON string / dict when used programmatically).
Notes
- The parser focuses on rendering nested JSON structures into a TOON text format.
- For input rules and behavior see
ToonEscape.ToonParser.ToonParser.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file toon_escape-0.2.0.tar.gz.
File metadata
- Download URL: toon_escape-0.2.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dc22ebd7ffa870ba3602582ae7ad17420c6bad1fc2fa80444c5e29957b298a2
|
|
| MD5 |
2a5535ef07128b6be5c51bf4c484c8aa
|
|
| BLAKE2b-256 |
cf4bf4a6b297c510cb6c4a49d2e3b01c385ed021c9b8ae5099dbb50315a1a71e
|
File details
Details for the file toon_escape-0.2.0-py3-none-any.whl.
File metadata
- Download URL: toon_escape-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6ed907a01c3987a8382869c8dfbe5d82074d67f861da15368f7090ff40cbf2c
|
|
| MD5 |
91ba0d75c3267d86526b6a4d909a5b7b
|
|
| BLAKE2b-256 |
5d074ed03b6eec151b72ce7f9e25d8b8ff78dafb3ec8547148c3365e8acc9a27
|