Skip to main content

toon-parser-async

Async wrapper for toon-parser - High-performance TOON format parser with asyncio support.

Installation

pip install toon-parser-async

This will automatically install toon-parser as a dependency.

Quick Start

import asyncio
from toon_parser_async import encode, decode, encode_batch, decode_batch

async def main():
    # Encode data
    data = {"name": "Alice", "age": 30}
    toon_str = await encode(data)
    print(toon_str)
    
    # Decode data
    decoded = await decode(toon_str)
    print(decoded)
    
    # Batch operations
    items = [{"id": i} for i in range(10)]
    encoded_items = await encode_batch(items)
    decoded_items = await decode_batch(encoded_items)

asyncio.run(main())

API

All functions are async and use asyncio.to_thread() to run the sync toon-parser functions in the thread pool:

  • async encode(data, delimiter=None, strict=None) - Encode Python data to TOON format
  • async decode(toon_str, delimiter=None, strict=None) - Decode TOON format to Python data
  • async dumps(data, **kwargs) - Alias for encode
  • async loads(toon_str, **kwargs) - Alias for decode
  • async encode_batch(data_list, **kwargs) - Encode multiple items concurrently
  • async decode_batch(toon_strs, **kwargs) - Decode multiple strings concurrently

Performance

toon-parser-async uses the high-performance toon-parser Rust library under the hood, which is 5.82x faster than other TOON implementations on average. The async wrapper adds minimal overhead while enabling concurrent I/O operations.

Credits

License

MIT License

Metadata

Release files for toon-parser-async 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for toon-parser-async 0.1.4
File Interpreter ABI Platform Actions
toon_parser_async-0.1.4-py3-none-any.whl Python 3 none any Details for toon_parser_async-0.1.4-py3-none-any.whl

Release files / toon_parser_async-0.1.4-py3-none-any.whl

Download URL toon_parser_async-0.1.4-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45f2c75bdacd354017b3c6a7a7f3ece79177aef6579f567eaf344e750be38c5a
BLAKE2b-256 checksum
How to use checksums
ff2e1e2dff1e548f5fb1bdadfea12219a96cd495e2b5b2ae6859abdda114b864
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Security for toon-parser-async 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.4 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page