Skip to main content

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:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

json_toon_converter-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file json_toon_converter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for json_toon_converter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f739337d1fc9451ccf0e56978c2df40facea28597554f11bc6eebc25e4c4cd6
MD5 541134884131659dc42d7eb7159fec82
BLAKE2b-256 3dfa6818c2d5553e10e92cc4e16c89011a9a9dc81b54e3f129da1dc259d1624d

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