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

PyPI version Downloads Python versions License

🌟 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.2.tar.gz (3.9 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.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: json_toon_converter-0.1.2.tar.gz
  • Upload date:
  • Size: 3.9 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.2.tar.gz
Algorithm Hash digest
SHA256 7d1f648a5ee44cf632584778da9398c83026c85ec5bf6a1438e4dcc683b776b7
MD5 4f42f9b1bfdab3043678cef136a1d2f6
BLAKE2b-256 0d234c71d85d4dcad0dbc1368e1ff17686619a6825fa02b5ef7da9fd1b88c986

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for json_toon_converter-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bae66011859c93c3125660103a828d78c458a255e4e4816adba1735b86d8bb44
MD5 6959f6cdf3a7486288194677bc1a418a
BLAKE2b-256 bda1bf6252709e957e1faa09e36e47e413545cea42d6fe54b6c93aa797fffb9f

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