A lightweight tool to convert JSON to TOON (TOML) and vice versa.
Project description
json-to-toon
json-to-toon (imported as json2toon) is a simple, reliable Python library for converting data between JSON and TOON (TOML-style) formats. It offers clean APIs, fast conversions, and a handy CLI, making it ideal for configuration files, automation workflows, and projects needing seamless cross-format compatibility.
Installation
pip install json-to-toon
Usage
from json2toon import to_toon, to_json
data = {
"title": "My Config",
"owner": {"name": "Admin", "id": 55},
}
toon_output = to_toon(data)
print(toon_output)
# Convert TOON string back to JSON
json_output = to_json(toon_output)
print(json_output)
CLI
Use the bundled CLI to convert files by extension:
j2t input.json output.toon
j2t settings.toon output.json
Project details
Release history Release notifications | RSS feed
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 json_to_toon-0.1.3.tar.gz.
File metadata
- Download URL: json_to_toon-0.1.3.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
128b08a5169087fbbdad602770ab1441e04555763b95a3546ef876889591c9c3
|
|
| MD5 |
4364701bbf6c4751a6c1755995aeac18
|
|
| BLAKE2b-256 |
ac6a88ad0afaf5ef8b2477803cec1ca461137915a1023abbc672663734618112
|
File details
Details for the file json_to_toon-0.1.3-py3-none-any.whl.
File metadata
- Download URL: json_to_toon-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2af6b33a6d6beb12cce172301a234296842145fc16a10781459a77a752f7a7a
|
|
| MD5 |
742546cd838d46b7c259d79101119bdb
|
|
| BLAKE2b-256 |
eb908d3102bf4ab384bb73713ca2444f8912df8ae4712a8f3cff6183cb1940ae
|