Black

The uncompromising Python code formatter that ends style debates with deterministic formatting

Tool
PyPI
v26.10.1
41,999 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
91 /100 Excellent
Development Activity 100
Maintenance 96
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
83 /100 Excellent
Architecture 85
Code Quality 88
Innovation 78
Learning Curve 82

Black is a PEP 8 compliant code formatter for Python that reformats entire files in place, deliberately offering very few configuration knobs. By ceding control over formatting minutiae, teams get speed, determinism, and freedom from line-by-line style bikeshedding: any two developers running Black on the same code produce byte-identical output. It’s one of the most widely adopted developer tools in the Python ecosystem, maintained under the Python Software Foundation and used as the reference formatter for CPython itself and countless open-source and commercial Python codebases.

What You Get

  • A black CLI that reformats files, directories, or stdin, with --check/--diff modes for CI enforcement without mutating files
  • blackd, an HTTP daemon exposing the formatter as a service to avoid per-invocation startup cost in editor integrations
  • A minimal, deliberately opinionated configuration surface (pyproject.toml [tool.black]) covering line length, target Python versions, and a small set of preview/stable style toggles
  • Jupyter Notebook formatting support (including magic-cell handling) via the black[jupyter] extra
  • First-class editor and CI integrations, including an official GitHub Action (psf/black@stable) and pre-commit hook

Common Use Cases

  • Enforcing a single, non-negotiable Python code style across a team or open-source project without formatting debates in code review
  • Running Black in CI (--check) to fail builds on unformatted code, or as a pre-commit/git hook to auto-format on commit
  • Formatting Jupyter Notebooks as part of a data-science team’s code quality pipeline
  • Migrating a legacy codebase to a consistent style in one pass, then relying on Black to keep it that way going forward

Under The Hood

Architecture Black’s pipeline runs source through blib2to3 (src/blib2to3, a maintained fork of lib2to3’s grammar/parser) to build a lossless concrete syntax tree, then src/black/linegen.py walks that tree to produce a sequence of Line objects (src/black/lines.py) representing logical output lines, which src/black/__init__.py’s top-level format_str/format_file_contents functions assemble into final text; src/black/brackets.py and nodes.py handle bracket-depth tracking and node classification that drive line-splitting decisions, while src/black/mode.py centralizes the (intentionally small) set of style parameters. src/blackd wraps the same formatting core in an aiohttp-based HTTP daemon for low-latency repeated calls from editors. Tech Stack Pure Python 3.10+, packaged with Hatchling and hatch-vcs for version derivation from git tags; the CLI is built on Click, and blackd adds aiohttp as an optional dependency. The project maintains its own CPython grammar fork rather than depending on the standard library’s ast module, so it can format both current and near-future Python syntax. Code Quality The tests/ directory contains 276 test files, including an extensive tests/data corpus of before/after fixture pairs covering edge cases across Python grammar versions, plus idempotency tests (formatting twice produces no further change) and a self-hosting check (Black formats its own source). CI covers multiple OSes and Python versions, and the project publishes a public change log with strict semantic-versioning-like discipline given unstable/preview style flags for staged rollout of new formatting rules. API Design The CLI surface is minimal and stable (black [path], --check, --diff, --line-length), reflecting the project’s philosophy of near-zero configuration; the small pyproject.toml [tool.black] surface means most users never need to read documentation beyond the README to get value, though power users wanting incremental style migrations must learn the preview/unstable flag semantics.

Used by 21 apps in this directory

Python
64%
Other

Keep

Automation · Devops · Monitoring

12,433

The open-source AIOps and alert management platform that unifies 130+ monitoring tools into a single pane of glass with AI-powered correlation, deduplication, and workflow automation.

View details
88
Repo Health
79
Technical
66
Dependency
Built with
Python 64%
TypeScript 36%
Updated 1 weeks ago
Svelte
32%
GPL 3.0

Mathesar

Databases

5,158

Spreadsheet-like interface for your PostgreSQL database — self-hosted, no SQL required, native Postgres access control.

View details
70
Repo Health
80
Technical
68
Dependency
Built with
Svelte 32%
TypeScript 27%
Python 21%
Updated 6 days ago
C++
66%
Other

Memgraph

AI Development · Databases

4,628

High-performance in-memory graph database for AI context and real-time analytics

View details
90
Repo Health
79
Technical
66
Dependency
Built with
C++ 66%
Python 18%
Updated 5 days ago
Go
93%
MIT

NornicDB

AI Development · AI Memory · Databases

916

A single graph+vector+temporal database for AI workloads — Neo4j-compatible, sub-millisecond hybrid search, and built-in memory decay.

View details
80
Repo Health
82
Technical
71
Dependency
Built with
Go 93%
Updated 5 days ago
Python
38%
Other

Open WebUI

AI Agents · AI Assistants

156,607

The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.

View details
92
Repo Health
75
Technical
66
Dependency
Built with
Python 38%
Svelte 35%
JavaScript 19%
Updated 5 days ago
Python
100%
Other

OpenBB

Analytics · Databases · Invoicing Finance

74,601

The AI Workspace for Finance: Connect Data, Run AI Agents, Build Analytics

View details
80
Repo Health
80
Technical
65
Dependency
Built with
Python 100%
Updated 1 weeks ago
Go
79%
Apache 2.0

OpenMeter

Developer Tools · Invoicing Finance

2,401

Open-source metering and billing engine for AI, agentic, and DevTool monetization — ingest usage events in real time and turn them into accurate invoices automatically.

View details
87
Repo Health
81
Technical
66
Dependency
Built with
Go 79%
TypeScript 16%
Updated 6 days ago
Rust
63%
MIT

PostgresML

AI Development · Databases

6,823

Run ML training and LLM inference natively inside PostgreSQL with GPU acceleration — no data movement required.

View details
51
Repo Health
76
Technical
64
Dependency
Built with
Rust 63%
JavaScript 11%
Updated 1 years ago
Python
99%
Apache 2.0

Rasa Open Source

AI Assistants · AI Development · Voice AI

21,353

Rasa Open Source is a Python machine learning framework for building contextual, multi-turn chatbots and voice assistants that understand natural language and maintain conversation state.

View details
62
Repo Health
78
Technical
63
Dependency
Built with
Python 99%
Updated 3 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers