Skip to main content

codemod-yaml

This library makes surgical edits to YAML documents, based on tree-sitter and inspired by tomlkit and pyupgrade. Preserves all whitespace and formatting on lines that don't require changes, and generally within a line as well, so you can make minimal diffs in your codemod tools.

Basic Usage

from codemod_yaml import parse
stream = parse(somepath.read_bytes())
if stream["version"] == ["2.7"]:
    stream["version"][:] = ["3.6", "3.13"]
somepath.write_bytes(stream.text)

Version Compat

Tested on Python 3.9-3.14. Linting requires 3.12+ for full fidelity.

Versioning

This library follows meanver which basically means semver along with a promise to rename when the major version changes.

License

codemod-yaml is copyright Tim Hatch, and licensed under the MIT license. See the LICENSE file for details.

Metadata

Release files for codemod-yaml 0.8.0

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

Source distribution (sdist)

Source distribution for codemod-yaml 0.8.0
File Size Uploaded
codemod_yaml-0.8.0.tar.gz 29.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for codemod-yaml 0.8.0
File Interpreter ABI Platform
codemod_yaml-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 46.7 kB

Release files / codemod_yaml-0.8.0.tar.gz

Download URL codemod_yaml-0.8.0.tar.gz
Size 29.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f19ac70d3c450d63c16b21f2fce95534259459b85097e854e7e34fd509a07303
BLAKE2b-256 checksum
How to use checksums
9ffc07dca08530a0d0a63be74fbacbc8734207cdb19a2c8f14465d23317b634e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log

Release files / codemod_yaml-0.8.0-py3-none-any.whl

Download URL codemod_yaml-0.8.0-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42ff2201d8c47ef3ee90f98e7e97018851f0c0efac8027b57aa56954d78083dc
BLAKE2b-256 checksum
How to use checksums
32a5b924841f917616b26ba7de7fc6c50f1e63e7b2c226163e0f47144ba4442f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.

Transparency log
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