Skip to main content

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


Download files

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

Source Distribution

google_yamlfmt-0.19.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distributions

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

google_yamlfmt-0.19.0-py3-none-win_arm64.whl (1.7 MB view details)

Uploaded Python 3Windows ARM64

google_yamlfmt-0.19.0-py3-none-win_amd64.whl (1.9 MB view details)

Uploaded Python 3Windows x86-64

google_yamlfmt-0.19.0-py3-none-musllinux_1_2_x86_64.whl (1.8 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

google_yamlfmt-0.19.0-py3-none-musllinux_1_2_i686.whl (1.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

google_yamlfmt-0.19.0-py3-none-musllinux_1_2_armv7l.whl (1.6 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARMv7l

google_yamlfmt-0.19.0-py3-none-musllinux_1_2_aarch64.whl (1.6 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

google_yamlfmt-0.19.0-py3-none-manylinux_2_17_x86_64.whl (1.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

google_yamlfmt-0.19.0-py3-none-manylinux_2_17_aarch64.whl (1.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

google_yamlfmt-0.19.0-py3-none-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

google_yamlfmt-0.19.0-py3-none-macosx_10_12_x86_64.whl (1.8 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file google_yamlfmt-0.19.0.tar.gz.

File metadata

  • Download URL: google_yamlfmt-0.19.0.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

Hashes for google_yamlfmt-0.19.0.tar.gz
Algorithm Hash digest
SHA256 af0211f27d1a7314319bd9bdce172e389911118f4bdfe889e75c28ca8c5fa276
MD5 741e354462eadc5492397ae8310fa796
BLAKE2b-256 8e2b4122defb9782f1775d1ccb08e77ce479e2ec3f88e162c3a9822bfa7991af

See more details on using hashes here.

File details

Details for the file google_yamlfmt-0.19.0-py3-none-win_arm64.whl.

File metadata

  • Download URL: google_yamlfmt-0.19.0-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

Hashes for google_yamlfmt-0.19.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 9ef14094e494141ca47100a6fc80fe1aac6191e527d39827f8eaa9b35c0cb8a2
MD5 243ecf7af44fe71aef0eeef8496cb910
BLAKE2b-256 3ccf97a7c2e65d44d819aa9e7cb30fe8f2c819e4db648ddf2158351ac2741b1a

See more details on using hashes here.

File details

Details for the file google_yamlfmt-0.19.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: google_yamlfmt-0.19.0-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

Hashes for google_yamlfmt-0.19.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 5d032c1eb5926aca6a5716d06502e2b06951f4945b35f53d099b034472ba8d0d
MD5 e9910709da480af3ec6417346debbecf
BLAKE2b-256 be2bc1a3afa5d6f6c649d7b3337f2359b56fc2df3c809c3fceed2d1be9dff6fe

See more details on using hashes here.

File details

Details for the file google_yamlfmt-0.19.0-py3-none-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: google_yamlfmt-0.19.0-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

Hashes for google_yamlfmt-0.19.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 13d00857357eedfcb02420e7fbfd6456cbae9a4a3a6a6a717832d52f9b1fab72
MD5 5e7c2a49a44992f802d689a84a68f383
BLAKE2b-256 be8a8d972bcdbb562d84de29beb82f3286bcde6a74d576d639aa377d857f3285

See more details on using hashes here.

File details

Details for the file google_yamlfmt-0.19.0-py3-none-musllinux_1_2_i686.whl.

File metadata

  • Download URL: google_yamlfmt-0.19.0-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

Hashes for google_yamlfmt-0.19.0-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 ba75704a188567ccf0abf26314804f369abfdf0dd8bc79bc19bb77529cc8cebf
MD5 e23e6d481512cb25604208a0188de699
BLAKE2b-256 67f75cfdb75e6b58808a6738a504fd07d9a255c50697cb90ad7483fbea83387f

See more details on using hashes here.

File details

Details for the file google_yamlfmt-0.19.0-py3-none-musllinux_1_2_armv7l.whl.

File metadata

  • Download URL: google_yamlfmt-0.19.0-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

Hashes for google_yamlfmt-0.19.0-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 3dbaac166406bf46b71294afeaf9ab89ed994c3969dd33d1319953677f969526
MD5 dbaf641208e63b53fc716078b2cfbfd6
BLAKE2b-256 119cfb9a7b40f9efe9808b0794ba4910b40f0f8921f2e22837e5ad42566268ff

See more details on using hashes here.

File details

Details for the file google_yamlfmt-0.19.0-py3-none-musllinux_1_2_aarch64.whl.

File metadata

  • Download URL: google_yamlfmt-0.19.0-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

Hashes for google_yamlfmt-0.19.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 08228ef96ff935ec87c6f2092ce845b90c8b53e72634abcae31983ce23b742c5
MD5 f39258ad9f71b61173eced68534a0820
BLAKE2b-256 cccbb6fc30f6480643010d964d22d924e6712a4d4bdfe9b16da59f0879acbdac

See more details on using hashes here.

File details

Details for the file google_yamlfmt-0.19.0-py3-none-manylinux_2_17_x86_64.whl.

File metadata

  • Download URL: google_yamlfmt-0.19.0-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

Hashes for google_yamlfmt-0.19.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 3b6bdea601fbded7cb4bb7553ccde0135c2477d6615036786fa9b9c98d16798a
MD5 3345dd33c3cea05265383d1504795bac
BLAKE2b-256 260898608d22badadaef257ae73e8a1161504179b549ef2236d0649b8db930ff

See more details on using hashes here.

File details

Details for the file google_yamlfmt-0.19.0-py3-none-manylinux_2_17_aarch64.whl.

File metadata

  • Download URL: google_yamlfmt-0.19.0-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

Hashes for google_yamlfmt-0.19.0-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 b9095f6c2e16743ba52a3e425a5acb92c291d4272d8815dda8c133cdb390bebc
MD5 85f1d7b29618d8f375459ca1e9237ed1
BLAKE2b-256 bb84c4e01b69ca6dc1f3fe4484828839f647c3c54acb33de189bb56dc8fd57e7

See more details on using hashes here.

File details

Details for the file google_yamlfmt-0.19.0-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: google_yamlfmt-0.19.0-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

Hashes for google_yamlfmt-0.19.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 accc3892ff26539f74d5d347ddc3ced1887db03db826573148a0143fe7e95015
MD5 f32ec3097afe0c74d704836e0218463b
BLAKE2b-256 2e823f12ec31465cc5d2a586a8d5623e000712c2a744d494e78393fdeb2298d2

See more details on using hashes here.

File details

Details for the file google_yamlfmt-0.19.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: google_yamlfmt-0.19.0-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

Hashes for google_yamlfmt-0.19.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7e85e471d66203b56b3683fc177c399ecca91fc0c63165005972df40c3cd1990
MD5 01e13176f35b9a59b0071abea117b71f
BLAKE2b-256 bef13aa3094eca34143afa6b186c858143726c1b121f00364baddb5ceaab854b

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