A package to convert JSON to TOON and TOON to JSON
Project description
JSON TOON Converter
json-toon-converter is a powerful Python library that helps you easily convert data between JSON and TOON formats. The TOON format is a compact, human-readable serialization format, perfect for reducing token usage in applications such as AI-driven models and data serialization. This package allows you to convert both JSON and TOON with minimal effort.
Python Version: 3.8+
PyPI Version: json-toon-converter
License: MIT License
Downloads: Available on PyPI
🌟 Key Features
- 🔄 Bidirectional Conversion: Convert JSON to TOON and TOON to JSON effortlessly.
- 🎯 Flexible Integration: Simple API for integrating into your Python projects.
- 🏷️ Token Savings: Save tokens when working with language models and APIs.
- 💡 Customizable Prompts: You can specify prompts for targeted description or formatting.
- 📝 Type Hints: Full type hints for better development experience.
- 🌐 CLI Support: Command-line interface for quick conversions and batch processing.
📦 Installation
To install the package, use pip:
pip install json-toon-converter
# 🚀 Quick Start
Import the package and use the provided functions to convert between **JSON** and **TOON** formats.
### Convert JSON to TOON
```python
from json_to_toon_converter import json_to_toon
json_data = {
"name": "Alice",
"age": 25,
"city": "Wonderland"
}
toon_data = json_to_toon(json_data)
print(toon_data)
Convert TOON to JSON
from json_to_toon_converter import toon_to_json
toon_data = '(name "Alice") (age 25) (city "Wonderland")'
json_data = toon_to_json(toon_data)
print(json_data)
🤝 Contributing
We welcome contributions! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Your contributions are greatly appreciated!
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
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 Distributions
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_toon_converter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: json_toon_converter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 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 |
1f739337d1fc9451ccf0e56978c2df40facea28597554f11bc6eebc25e4c4cd6
|
|
| MD5 |
541134884131659dc42d7eb7159fec82
|
|
| BLAKE2b-256 |
3dfa6818c2d5553e10e92cc4e16c89011a9a9dc81b54e3f129da1dc259d1624d
|