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 Distribution

json_toon_converter-0.1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

Details for the file json_toon_converter-0.1.1.tar.gz.

File metadata

  • Download URL: json_toon_converter-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for json_toon_converter-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d3fc8042ff773c1d59eeb8f528a8d3137712b3fbc351d25fa20187da3cccef69
MD5 b652697c59fe79745dad48d4617474ed
BLAKE2b-256 613f90063567ec7dbdc8844488f7f84f489500b93a23894d640bdea66e9f11c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for json_toon_converter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a73386609408063005616030137ef22b9ae410f0dcd94dcd06bf05bbab5a4ad
MD5 008ef255677315797b9228e32bf17b08
BLAKE2b-256 0326877c2626a52291c6786fcf7d80e0c76baafecaa5c105197985752043ea73

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