Skip to main content

JSON to YAML Lite

A zero-dependency Python micro-tool that converts JSON strings into YAML. It does not require PyYAML and is optimized specifically for reducing LLM token usage in prompts.

Installation

pip install json-to-yaml-lite

Usage

from json_to_yaml_lite import convert_json_to_yaml

json_schema = """
{
  "employees": [
    {"firstName": "John", "lastName": "Doe"},
    {"firstName": "Anna", "lastName": "Smith"}
  ]
}
"""

print(convert_json_to_yaml(json_schema))

Output: (Token-efficient YAML)

employees:
  - firstName: John
    lastName: Doe
  - firstName: Anna
    lastName: Smith

Download files

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

Source Distribution

json_to_yaml_lite-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

json_to_yaml_lite-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file json_to_yaml_lite-0.1.0.tar.gz.

File metadata

  • Download URL: json_to_yaml_lite-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for json_to_yaml_lite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 54237604f7f182d51ca1f9324065de566bb00db27aba64d85c45b43058ff5c38
MD5 57016fa7afb08fab6a470edea0dc1682
BLAKE2b-256 49110c3f7afe81db202758258d7a805ba145940ba8e7ff28410420c40ec77869

See more details on using hashes here.

Provenance

The following attestation bundles were made for json_to_yaml_lite-0.1.0.tar.gz:

Publisher: publish.yml on Encephos/json-to-yaml-lite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for json_to_yaml_lite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80ef22329445b5e5254f3b9bed2940724a4b81b41e81f21617de6c3beed685ef
MD5 061147f036b7239ed1bd5bb96f867619
BLAKE2b-256 a84c73e6c84eb7a1eb6fbf332e47e8f420bfc4d0ee609cefc9f86afc95230aad

See more details on using hashes here.

Provenance

The following attestation bundles were made for json_to_yaml_lite-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Encephos/json-to-yaml-lite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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