shfmt-py
Python wrapper around invoking shfmt (https://github.com/mvdan/sh)
Decision gist · record as of 2026-08-14
Yes, if you need to format shell scripts in a Python environment or CI/CD pipeline. The package is actively maintained, has no runtime dependencies, and provides convenient platform-specific binary distribution. Medium install friction (platform-specific downloads) is a minor trade-off for avoiding manual binary management. Be aware that the bundled shfmt version does not directly mirror the PyPI version—check release notes for the exact upstream version you're getting.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Binary downloads occur at install time; SSL certificate issues may occur on macOS and require manual certificate installation.
- Medium install friction due to platform-specific binary downloads at install time.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions—you may use, modify, and distribute this package freely as long as you include the license notice.
last release 2026-05-13 (93 days) · last repo commit 2026-08-10 · 19 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 286,537 downloads/mo, #8,042 on PyPI
Alternatives
Verify before relying
pip install shfmt-py
shfmt --version
shfmt -i 2 script.sh- Whether the bundled shfmt version is documented clearly enough for users who need a specific upstream shfmt release.
- Performance impact of the binary download during installation on slow or unreliable networks.
What it is and what it does
shfmt-py is a Python wrapper that downloads and bundles the shfmt shell script formatter binary for your operating system at install time. Once installed, it makes the shfmt command available on your PATH (or as shfmt.exe on Windows), allowing you to format shell scripts from the command line or integrate formatting into your development workflow via pre-commit hooks.
The package has no runtime dependencies and is independently versioned from the upstream shfmt project—each release notes specify which shfmt version is bundled. It supports Python 3.9 and later on CPython and PyPy, and provides platform-specific wheels for macOS (Intel and ARM), Linux (x86_64 and aarch64), and Windows. The wrapper handles the complexity of downloading the correct binary for your platform, so you get a consistent shfmt experience across development machines without manual binary management.
Use it for
- Enforce consistent shell script formatting in CI/CD pipelines by installing shfmt-py and running it as a linter step.
- Set up a pre-commit hook to automatically format shell scripts before commits, using the sample .pre-commit-config.yaml configuration.
- Format shell scripts locally during development without manually downloading or managing the shfmt binary for your platform.
- Integrate shell script formatting into Python-based build or deployment tools that need to standardize script formatting.
- Ensure shell script style consistency across a team by pinning a specific shfmt-py version in a shared development environment.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to format shell scripts in a Python environment or CI/CD pipeline.
The package is actively maintained, has no runtime dependencies, and provides convenient platform-specific binary distribution. Medium install friction (platform-specific downloads) is a minor trade-off for avoiding manual binary management. Be aware that the bundled shfmt version does not directly mirror the PyPI version—check release notes for the exact upstream version you're getting.
Install
shfmt-py on PyPI
Before you install
Medium install friction due to platform-specific binary downloads at install time. The package is actively maintained with a recent release (93 days ago) and supports current Python versions (3.9+). No runtime dependencies simplifies the installation footprint.
Requires Python 3.9 or later. Binary downloads occur at install time; SSL certificate issues may occur on macOS and require manual certificate installation.
License in practice
MIT license permits commercial and private use with minimal restrictions—you may use, modify, and distribute this package freely as long as you include the license notice.
Quickstart
pip install shfmt-py
shfmt --version
shfmt -i 2 script.sh
Verify before relying
- Whether the bundled shfmt version is documented clearly enough for users who need a specific upstream shfmt release.
- Performance impact of the binary download during installation on slow or unreliable networks.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 93 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 286,537 / month, #8,042 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy |
Evidence: shfmt_py-4.0.0-py2.py3-none-macosx_10_9_x86_64.whl; shfmt_py-4.0.0-py2.py3-none-macosx_11_0_arm64.whl; shfmt_py-4.0.0-py2.py3-none-manylinux2014_aarch64.whl; shfmt_py-4.0.0-py2.py3-none-manylinux2014_x86_64.whl; shfmt_py-4.0.0-py2.py3-none-win_amd64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “shell script formatter”
- shfmt-pyProvides a Python-installable wrapper that bundles the shfmt shell…
- beautyshBeautysh automatically formats and beautifies Bash shell scripts with…
- bashatebashate is a style checker for bash scripts that applies pep8-like…
Give your agent the search over MCP, or paste the wish link into any chat.
More Build Tools packages
Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.
Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.
Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.
pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.
Install it if your team needs consistent, automated validation at commit time.
See also shellcheck-py · hadolint-coatl · clang-format · actionlint-py · reformat-gherkin · add-trailing-comma · ruff-format · beautysh · mdformat-ruff · actions-toolkit