pyclang
A python clang-tidy runner
What it is and what it does
Pyclang is a Python wrapper around clang-tidy, the LLVM static analysis tool for C and C++. It provides a chainable API to orchestrate clang-tidy runs across directories, allowing you to compose analysis workflows programmatically—configure the build environment, filter files, run the analysis, and normalize results—without writing shell scripts. The package includes a built-in command-line script (idf_clang_tidy) for ESP-IDF projects that chains common steps automatically.
The core design centers on the Runner class: you instantiate it with a list of directories, chain method calls to define your analysis pipeline, then invoke the instance to execute all steps. You can also subclass Runner and use the @chain decorator to add custom analysis steps. It depends on esp-pylib for environment handling and rich for terminal output formatting.
Use it for:
- Automate clang-tidy analysis in CI/CD pipelines for C/C++ projects without writing shell wrappers
- Run static analysis on ESP-IDF projects using the predefined idf_clang_tidy script with standard workflow steps
- Build custom analysis workflows by chaining Runner methods to configure, filter, and normalize code quality checks
- Integrate clang-tidy into Python-based build systems or project management tools that need programmatic control
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pyclang wraps clang-tidy to run static analysis checks on C/C++ code directories, with chainable methods for configuring analysis steps and a command-line interface for common workflows.
Yes, if you need to run clang-tidy from Python or automate it in a build pipeline. Low install friction, permissive license, no known vulnerabilities, and active maintenance make it a safe choice. Verify that clang-tidy itself is available on your system and that esp-pylib meets your environment requirements.
Install
pyclang on PyPI
pip
pip install pyclanguv
uv add pyclangpoetry
poetry add pyclangInstalling pyclang
Before you install
Low install friction; pure Python wheel with only two runtime dependencies (esp-pylib and rich). Active maintenance with a release 32 days ago.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely provided you include the license notice.
Quickstart
pip install pyclang
import os
from pyclang import Runner
runner = Runner(['/path/to/code'])
runner.idf_reconfigure().normalize()
runner()
Requires clang-tidy to be installed and available on the system PATH; typically part of LLVM/Clang toolchain.
Verify before relying
- Whether clang-tidy version compatibility is documented or constrained
- Whether esp-pylib and rich are optional or always required at runtime
- Performance characteristics when analyzing large codebases
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — esp-pylib, rich |
| Maintenance | actively maintained — 32 days since the last release |
| First released | |
| Downloads | 489,584/month — #6,375 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyclang-0.7.0-py3-none-any.whl
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
clang-tidyPackages the clang-tidy C++ linter and related…
permissive · top 15,000 on PyPI
clangd-tidyclangd-tidy wraps clangd to provide faster…
permissive · top 15,000 on PyPI
bashProvides a Python wrapper for running bash…
copyleft · top 15,000 on PyPI
litlit is a portable test runner for executing…
permissive · top 5,000 on PyPI
robotcode-runnerProvides test execution and runner utilities…
permissive · top 15,000 on PyPI
undecoratedStrips decorators from Python functions,…
permissive · top 15,000 on PyPI
styleApplies ANSI color and text styling to terminal…
permissive · top 15,000 on PyPI
cdk-gitlab-runnerDefines AWS infrastructure for GitLab Runner…
permissive · top 15,000 on PyPI
just-binDistributes the `just` command-line task runner…
permissive · top 15,000 on PyPI