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.18.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.18.0-py3-none-win_arm64.whl (1.7 MB view details)

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

google_yamlfmt-0.18.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.18.0-py3-none-musllinux_1_2_i686.whl (1.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

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

Uploaded Python 3musllinux: musl 1.2+ ARMv7l

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

google_yamlfmt-0.18.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.18.0-py3-none-manylinux_2_17_aarch64.whl (1.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

google_yamlfmt-0.18.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.18.0.tar.gz.

File metadata

  • Download URL: google_yamlfmt-0.18.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.18.0.tar.gz
Algorithm Hash digest
SHA256 137d4e7cb92bb6de0d39dedd3a4928ec4326d5ad74411afe19f8bb2556cc0e68
MD5 c3259bccb2ff3bcc3a0b9f223222744f
BLAKE2b-256 7fb451d5b5e7dfea7660e64757ab43c8c0c30405591e23e793ce5b9fe5c1cb81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: google_yamlfmt-0.18.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.18.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 adbd25fb9fac3d11662042ce3c3c4cb3016cb2d34fdb634ab305552884b046b9
MD5 9864ef22d89b0209595eeddb66d52801
BLAKE2b-256 fc6bbc54147a43bbd700338a5254aa0c9132ea1ccd9b9bf9e1a795e110531d2b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: google_yamlfmt-0.18.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.18.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a36465f08bbfe0a54887bf4d2102b238350f0a57b1e0ea0d5902fbd01faebef2
MD5 52800e42f042faa242d23e3944339592
BLAKE2b-256 25479f0be267cfe621281482efb70a31b99edf35f10246e029068c9aff3f011a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: google_yamlfmt-0.18.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.18.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 03809a87792969b2dec9e8bd4cebc8bb3de6d1a809987904335cfbb5a5353e3f
MD5 b774334d1fb013ea4556b5c96df0a929
BLAKE2b-256 79a33f9e651fb615bfee86341606d1477710831eb068ae7e23dc30b31d856955

See more details on using hashes here.

File details

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

File metadata

  • Download URL: google_yamlfmt-0.18.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.18.0-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 e8e0faf9afc000acd38e5ad1115385cb1e5af1bf764ce6272b718462cd240795
MD5 d61d267c154294dc45fddbf64f5ef48e
BLAKE2b-256 a4541787a9c7b6031d79acf199d15316c8dad28021b6b7c96600194c43df2a1e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: google_yamlfmt-0.18.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.18.0-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 0cd90fddcce7d396605289d78d4290c7155ba2c8589cf627e8cfb87132cf3076
MD5 55f5b02adc85be2e9af3bf37f35119e9
BLAKE2b-256 a7ffe4fc43ae2d0c2222f43ec12d2eea5a81f74da8c7694621acd4f9189c5427

See more details on using hashes here.

File details

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

File metadata

  • Download URL: google_yamlfmt-0.18.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.18.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 ceb942d887d674fb585958a4a5b539fc24169f8070c7ebe4fb574ccdbc23d77c
MD5 d4926871d4ff689aa1f5137eb55840df
BLAKE2b-256 66dd2b09c11fa58f42be9a30dd8c1beaff02036361394262485f55bca0d33045

See more details on using hashes here.

File details

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

File metadata

  • Download URL: google_yamlfmt-0.18.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.18.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 30affc1ca3f48c9589e099af230f3b6a4a2ade0d7cb0489bc9213739834a39a7
MD5 f0c7c31a6073aafc61b9c48a48ecd6a4
BLAKE2b-256 ab9984a1b4a41451541f4c7567d452bce77a63451730fc8546c460105e2d57c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: google_yamlfmt-0.18.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.18.0-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 df8b85c05b8dbfad1f9c5f9dc815947c592d56b88c1f021fa249e26102219398
MD5 645791397e103b221885377bad54e0ae
BLAKE2b-256 882dd3176cb6f292d72ef4098ddf76f6da6a03e14430ac53e191ed73e1fa6f07

See more details on using hashes here.

File details

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

File metadata

  • Download URL: google_yamlfmt-0.18.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.18.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4ab056a45de0fe528a743a9ed4bfe47ab8dd8263cee047bc52fb90182f0acb88
MD5 9788264221733e5bf859abf58a14faee
BLAKE2b-256 2d00704a83251948d7c9f0c3b4eb9a34751a02257bfb58f5a060f80e880138ef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: google_yamlfmt-0.18.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.18.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 04be6349a8b65f2b568a93ab416679bfc99a6feadc160a66ad226ab6c6de343c
MD5 68fb3f569bc221c76742c3dc93a556c2
BLAKE2b-256 a28d4d3559d0e84e49d2c6a2157f84bb50c6896e3231c3dd4409e61fbf6e3639

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