A tool for formatting YAML files, yamlfmt from Google: https://github.com/google/yamlfmt
Project description
google-yamlfmt
A PyPI packaging repository for yamlfmt, making it easily accessible to the Python ecosystem.
Overview
This repository provides a Python package wrapper for Google's yamlfmt tool, enabling seamless integration with Python package managers and development workflows. The original yamlfmt is a powerful YAML formatter written in Go, and this package makes it available through PyPI for easier installation and use in Python projects.
Features
- Easy Installation: Install via pip or any Python package manager
- Python Ecosystem Integration: Works seamlessly with Python development workflows
- Pre-commit Support: Perfect for use with pre-commit hooks
- Cross-platform: Available on all platforms supported by the original yamlfmt
Installation
To install google-yamlfmt, ensure you have Python 3.9 or higher, then run:
pip install google-yamlfmt
Usage
After installation, you can format YAML files using the yamlfmt command:
yamlfmt <file_or_directory>
Examples:
# Format a single file
yamlfmt example.yaml
# Format multiple files
yamlfmt file1.yaml file2.yaml
# Format all YAML files in current directory
yamlfmt *.yaml
# Check if files need formatting (lint mode)
yamlfmt -lint example.yaml
For more advanced usage options and configuration, please refer to the original documentation or run yamlfmt -h.
Pre-commit Integration
To use with pre-commit, add this to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/PFCCLab/yamlfmt-pre-commit-mirror.git
rev: v0.17.2
hooks:
- id: yamlfmt
About
This package is a redistribution of the original yamlfmt tool created by Google. All credit for the core functionality goes to the original maintainers. This packaging effort aims to make the tool more accessible to Python developers and integrate better with Python-based development workflows.
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests to help improve this packaging and distribution effort.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file google_yamlfmt-0.18.1.tar.gz.
File metadata
- Download URL: google_yamlfmt-0.18.1.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12863b642d73c484ba66cc218536a99fee6732a0f42d10c0729d9216990877aa
|
|
| MD5 |
b79ad58680b583f86769c947caf07e2c
|
|
| BLAKE2b-256 |
69f138afb0760521b1e81e535221fd66cf0b92b285424ddb15e37a7cc65b4afe
|
File details
Details for the file google_yamlfmt-0.18.1-py3-none-win_arm64.whl.
File metadata
- Download URL: google_yamlfmt-0.18.1-py3-none-win_arm64.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3, Windows ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
069cf45c6300b37dc4fc7031af75dd77627a52e09ee212f036b8811630b4298b
|
|
| MD5 |
7703157315894bba83e6ac9198f3a32b
|
|
| BLAKE2b-256 |
8971d59f7c081e290e04a04016269cd8201a5c669697a5bbf902541bb6d41a2a
|
File details
Details for the file google_yamlfmt-0.18.1-py3-none-win_amd64.whl.
File metadata
- Download URL: google_yamlfmt-0.18.1-py3-none-win_amd64.whl
- Upload date:
- Size: 1.9 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c66bdec93b54bafc1890ddf1d6c82b2af849b6a212ebc5970aac579d12a73d13
|
|
| MD5 |
386f6397c09805f47d522262e6d6406b
|
|
| BLAKE2b-256 |
fdc28940447dca74c9b4fe478567e15ddee8417ba82f53ba6029d2a8764870ed
|
File details
Details for the file google_yamlfmt-0.18.1-py3-none-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: google_yamlfmt-0.18.1-py3-none-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0eee631afdb20a3f12c601ffbf635a2b801978375c2a5fe97da71d3478c79827
|
|
| MD5 |
3f6065f4aa615bbcd0072fba1048a2a9
|
|
| BLAKE2b-256 |
32023c7492931bc38aaa9ca601aea6d1eee0eabb4153da04b1c7c686c356ef5b
|
File details
Details for the file google_yamlfmt-0.18.1-py3-none-musllinux_1_2_i686.whl.
File metadata
- Download URL: google_yamlfmt-0.18.1-py3-none-musllinux_1_2_i686.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8faf0d9608d27dad6a6b7cc1af5e41836ff413692c2bbf5aa1353ab3efd3e2ca
|
|
| MD5 |
e59aebe8392a989f5e3a8be88ee0a0c6
|
|
| BLAKE2b-256 |
4a023d2e6d18a6cdc0681f9f3af9afda0a4c74b41bb0a42b13c51b1635634a6f
|
File details
Details for the file google_yamlfmt-0.18.1-py3-none-musllinux_1_2_armv7l.whl.
File metadata
- Download URL: google_yamlfmt-0.18.1-py3-none-musllinux_1_2_armv7l.whl
- Upload date:
- Size: 1.6 MB
- Tags: Python 3, musllinux: musl 1.2+ ARMv7l
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6026e25544d2830c3f47e70373884650b2aed87b6fba751c2bf1d94c4db645df
|
|
| MD5 |
1378d64cfd27303aa812e2a49af342c6
|
|
| BLAKE2b-256 |
f2ce2ebc317f8176917f1dad3eb4643e65021e23187b7defd3c7784e0d1e79c8
|
File details
Details for the file google_yamlfmt-0.18.1-py3-none-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: google_yamlfmt-0.18.1-py3-none-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 1.6 MB
- Tags: Python 3, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
222c3e28a0d2672d936fd74bbe175682abe3c9995a2aaace57e6452ffa8a3be1
|
|
| MD5 |
0ba5774d4eb1383071d3ac7211f522b1
|
|
| BLAKE2b-256 |
ed15807b26ee30c32267a99339ef0858977c35cf85df680e0e4934081fe54cb0
|
File details
Details for the file google_yamlfmt-0.18.1-py3-none-manylinux_2_17_x86_64.whl.
File metadata
- Download URL: google_yamlfmt-0.18.1-py3-none-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1114136c4d72df6f8578006d4d71b500c592b222230d5a9b5468f90b0cd95b0
|
|
| MD5 |
7619a7e4ba024ee33f64b587ef852b6b
|
|
| BLAKE2b-256 |
b0dc2c0358ce7d260c6e5d2078d746e120ec811adab32bbd78f59d143a1348e9
|
File details
Details for the file google_yamlfmt-0.18.1-py3-none-manylinux_2_17_aarch64.whl.
File metadata
- Download URL: google_yamlfmt-0.18.1-py3-none-manylinux_2_17_aarch64.whl
- Upload date:
- Size: 1.6 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3770a46a70f27d9b28574f5eff68770815276f96d48611e053ab7b12ef7f5d2
|
|
| MD5 |
2b3696c077261444116a5baa9f6e1993
|
|
| BLAKE2b-256 |
56bed43f1a83ce561ef4b7fa36ca16925bcb30cb022d82f70dbb4dffd59bc1ff
|
File details
Details for the file google_yamlfmt-0.18.1-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: google_yamlfmt-0.18.1-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
301024b0b8d1ff9a3a5cddaa8f7496bf6ab6effc55a638da503760d72d1da5d8
|
|
| MD5 |
af132cb1280b5284278ccd661944257a
|
|
| BLAKE2b-256 |
b97505f4bc283fb473ee648651c63186d99164a12bd59606528ed0fbc18f1411
|
File details
Details for the file google_yamlfmt-0.18.1-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: google_yamlfmt-0.18.1-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efe8f2038fcc40bab832492503fffc3bc98b18ff65b0c74629e4255934b167fb
|
|
| MD5 |
79ee224a3de86e63ff3ca196cc44b342
|
|
| BLAKE2b-256 |
8bab598507a40fcb61544eb491cc4fe8538d0b291d24e63a962df11382a98216
|