Skip to main content

YAML Lex Formatter

yaml-lex is a Python tool for reformatting YAML files with specific wrapping rules.

It is designed to make YAML files more readable and maintainable, particularly for content-heavy nodes like content, caption, and title.

Features

✅ Wraps long strings at a configurable line width ✅ Preserves blank lines and paragraph breaks ✅ Converts long text into block scalars (|-) for YAML readability ✅ Special rules for common keys: - content → always block scalar unless it contains a Markdown table - caption / title → flattened into single line, then wrapped if too long - Other long strings → wrapped into block scalars ✅ Detects and preserves Markdown tables (avoids breaking table formatting) ✅ Works on a single file or recursively on a folder of YAML files ✅ In-place editing or output to a new file

Notes

  • Rich logging using rich.
  • Fully compatible with doctest-style examples for testing.
  • Supports CI/CD workflows with testing, linting, pre-commit hooks, and docs building.

Release files for yaml-lex 0.2.2

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

Source distribution (sdist)

Source distribution for yaml-lex 0.2.2
File Size Uploaded
yaml_lex-0.2.2.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yaml-lex 0.2.2
File Interpreter ABI Platform
yaml_lex-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 13.5 kB

Release files / yaml_lex-0.2.2.tar.gz

Download URL yaml_lex-0.2.2.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
eea7cd2d16f44642391b6b4ce19e4f8a8a7e69043a5a6104433e7ef7b379cf0f
BLAKE2b-256 checksum
How to use checksums
826083593f460753c4297b9e5f44248cfa75723a219d3ff3135a8c4053aa0d17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.22

Release files / yaml_lex-0.2.2-py3-none-any.whl

Download URL yaml_lex-0.2.2-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a721574f263dd4c8fdb9b195255c72702f5216591577405049c6f131e87900dd
BLAKE2b-256 checksum
How to use checksums
ce87f3d5d0ac427ac76bb2c8a270ab6d5dbc8d8f1fedd550abb673731ce0d8d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.22

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release 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