Skip to main content

No project description provided

Project description

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

Project details


Download files

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

Source Distribution

yaml_indent-0.1.2.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

yaml_indent-0.1.2-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file yaml_indent-0.1.2.tar.gz.

File metadata

  • Download URL: yaml_indent-0.1.2.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for yaml_indent-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8b36423a3110f73fe134c110163f91ce78404dc2cdb63605c050dc95e0af830a
MD5 42383f1c914a9730fd40a1d9645ed4e7
BLAKE2b-256 9f7f98f4b781f257092ff11e1a28c8d14b8a320d64f2f4e0e55aa26f9c4557ab

See more details on using hashes here.

File details

Details for the file yaml_indent-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: yaml_indent-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for yaml_indent-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 da92c147531c57be382400bdc3ea9e8b68f89d6d73a18b25871e7089fad80433
MD5 2259d6fbb18ffe50ed2054cb4dfcbf8d
BLAKE2b-256 1717de2692835a06e4a896d5929699c52c08053167e179cc7494a33f592927e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page