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.4

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.4
File Size Uploaded Provenance Actions
yaml_indent-0.1.4.tar.gz 15.8 kB Without provenance Details for yaml_indent-0.1.4.tar.gz

Built distribution (wheel)

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

Total release size: 32.2 kB

Release files / yaml_indent-0.1.4.tar.gz

Download URL yaml_indent-0.1.4.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
242ac9ea61871272d37e358259aa1afbfc505a61b22c684711c5c308108ec28e
BLAKE2b-256 checksum
How to use checksums
7e5f077dd7b1df7a4c67293f8e5a262e31e090d5b7db785ef4b61f364df03817
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.4-py3-none-any.whl

Download URL yaml_indent-0.1.4-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7b2b376f452d6f42d446b38be4f9f5e7276557f96e2b3db88329a05d177202c
BLAKE2b-256 checksum
How to use checksums
c4c68d46435c30ee87b317a42b48bf84e9b5d159e127e91b597ff2ed5c3c3c16
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.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.

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