Skip to main content

YAML Indent

yaml-indent is a Python script to re-indent YAML files according to configurable or default indentation rules. It uses the ruamel.yaml library for parsing and writing YAML.

Installation

The script requires Python 3.

pip install yaml-indent

Usage

You can run yaml-indent from the command line with the following syntax:

yaml-indent <input_file> [-o <output_file>] [-i]

Where:

  • <input_file> is the path to the input YAML file to be re-indented.
  • -o <output_file> (optional) is the path to the output file where the indented YAML will be written.
  • -i (optional) if set, the input file will be edited in place.

If no output file is specified and -i is not set, the indented YAML will be printed to the standard output.

Configuration

yaml-indent looks for a .yaml_indent.ini configuration file in the the yaml files directory and all parent directories up to the home directory. The configuration file should be in the INI format and can specify the mapping, sequence, and offset indentation values under the YAML section.

Here's an example:

[YAML]
mapping=4
sequence=4
offset=0

Contributing

Contributions to this project are welcome. If you find a bug or think of a feature that this utility could benefit from, please open an issue or submit a pull request.

Source Code

The source code for this project is hosted on GitHub. You can access it at https://github.com/knobo/yaml-indent.

License

This project is open source under the terms of the GPL License.

Metadata

Release files for yaml-indent 0.1.3

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-indent 0.1.3
File Size Uploaded Provenance Actions
yaml_indent-0.1.3.tar.gz 15.4 kB Without provenance Details for yaml_indent-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yaml-indent 0.1.3
File Interpreter ABI Platform Actions
yaml_indent-0.1.3-py3-none-any.whl Python 3 none any Details for yaml_indent-0.1.3-py3-none-any.whl

Total release size: 31.3 kB

Release files / yaml_indent-0.1.3.tar.gz

Download URL yaml_indent-0.1.3.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ecbe9cf19641acf9c965de55f6d28768f7338c36d06499fd3d7893fc416db5ec
BLAKE2b-256 checksum
How to use checksums
c39137744a92253b4beb73ac0fef8bdff197729dd1028d3d7eca718f68df99b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / yaml_indent-0.1.3-py3-none-any.whl

Download URL yaml_indent-0.1.3-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2b2f51eda5eead56cc52fbe282054fadb7c7650436b249d911f3fbdd2880510
BLAKE2b-256 checksum
How to use checksums
565c7c509e1a8a8ef92da5de71dba5a8be583d0bfea6e9077995a57d20a87ec4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Security for yaml-indent 0.1.3

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.

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