pyink
Pyink is a python formatter, forked from Black with slightly different behavior.
What it is and what it does
Pyink is a Python formatter maintained by Google as a medium-term adoption bridge for teams that cannot immediately migrate to Black. It forks Black's codebase and applies several localized patches that change how code is wrapped and indented, while remaining compatible with Black's command-line interface and configuration structure.
The main differences include support for two-space indentation, inferring quote style from file majority, preserving trailing pragma comments without wrapping, and keeping parentheses around multi-line strings in function arguments. Pyink is designed to be gradually phased out as its patches are upstreamed to Black or teams migrate fully. It depends on Black, click, mypy-extensions, packaging, pathspec, platformdirs, pytokens, tomli, and typing-extensions, and runs on Python 3.10 and later.
Use it for:
- Gradually migrate a large monorepo from inconsistent formatting to Black-compatible style without disrupting all developers at once.
- Enforce two-space indentation in Python projects that prefer it over Black's default four-space standard.
- Maintain consistent quote style across a codebase by automatically inferring single or double quotes based on file majority.
- Format code while preserving trailing pragma comments (e.g., `# pylint: disable`) without line wrapping.
- Use as a drop-in Black replacement in CI/CD pipelines with minimal configuration changes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pyink is a Python code formatter forked from Black that applies Black's formatting rules with several customizable behavioral differences, including optional two-space indentation and majority-quote inference.
Yes, if you need Black-compatible formatting with specific behavioral customizations (two-space indentation, majority quotes, pragma preservation) or are managing a gradual migration to Black in a large codebase. The package is actively maintained, has no known vulnerabilities, and low install friction. Not necessary if you are already using Black or do not need its specific formatting variants.
Install
pyink on PyPI
pip
pip install pyinkuv
uv add pyinkpoetry
poetry add pyinkInstalling pyink
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained as of August 2026 with recent commits and no known vulnerabilities. Depends on Black and related tooling libraries, all of which are stable and widely used.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.
Quickstart
pip install pyink
pyink --help
pyink myfile.py
pyink --pyink-indentation 2 myfile.py
Requires Python 3.10 or later.
Verify before relying
- Whether Pyink's patches remain synchronized with Black's latest releases and how often rebasing occurs.
- Performance characteristics compared to Black on large codebases or monorepos.
- Community adoption rate and stability of the formatting rules across versions.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — black, click, mypy-extensions, packaging, pathspec, platformdirs, pytokens, tomli, typing-extensions |
| Maintenance | actively maintained — 224 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 467,199/month — #6,499 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyink-25.12.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
mdformat-blackA plugin for mdformat that automatically…
permissive · top 15,000 on PyPI
config-formatterAutomatically formats .ini and .cfg…
permissive · top 15,000 on PyPI
paragraphsProvides a single function that joins…
permissive · top 15,000 on PyPI
darkerDarker reformats Python source code in Git…
permissive · top 15,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
docstrfmtAutomatically formats reStructuredText in files…
permissive · top 15,000 on PyPI
autopep8autopep8 automatically reformats Python code to…
permissive · top 5,000 on PyPI
wadler-lindigFormats Python objects for readable output…
permissive · top 5,000 on PyPI
dprint-pydprint-py is a Python wrapper for dprint, a…
permissive · top 15,000 on PyPI