pylint-protobuf
A plugin for making Pylint aware of the fields of protobuf-generated classes
What it is and what it does
pylint-protobuf is a Pylint plugin that teaches Pylint to understand the structure and type constraints of protobuf-generated Python classes. When you generate Python code from .proto files using protoc, the resulting classes have dynamically created fields that Pylint normally cannot inspect; this plugin bridges that gap by recognizing protobuf message definitions and their field types, allowing Pylint to catch errors like passing positional arguments to message constructors, assigning values to non-existent fields, or assigning wrong types to typed fields.
The plugin integrates directly into Pylint's analysis pipeline and emits custom error codes (e.g., protobuf-no-posargs, protobuf-undefined-attribute, protobuf-type-error) when it detects violations. It is most useful if you consume protobuf-generated code but do not control the .proto definitions or the code generation pipeline; if you control the entire pipeline, mypy-protobuf (a protoc plugin) may be a better fit.
Use it for:
- Catch type errors in protobuf message field assignments during code review before runtime.
- Detect attempts to access fields that don't exist in a protobuf message definition.
- Enforce correct constructor usage for protobuf messages (keyword-only arguments).
- Lint downstream code that consumes pre-generated protobuf modules without access to .proto files.
- Integrate protobuf validation into existing Pylint-based CI/CD workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Pylint plugin that makes Pylint understand protobuf-generated classes, catching type mismatches, invalid field access, and constructor errors that would otherwise go undetected.
Yes, if you work with protobuf-generated Python code and want Pylint to catch protobuf-specific errors. The plugin is stable and low-friction to install. However, maintenance is dormant (last release 2023-12-10, no recent commits), so verify compatibility with your current pylint and protobuf versions before relying on it in production. Not necessary if you use mypy-protobuf or control the entire protobuf pipeline.
Install
pylint-protobuf on PyPI
pip
pip install pylint-protobufuv
uv add pylint-protobufpoetry
poetry add pylint-protobufInstalling pylint-protobuf
Before you install
Low friction to install; depends on astroid, pylint, and protobuf. Maintenance is dormant—last release was 2023-12-10 and no commits since then—so expect no active bug fixes or feature updates, though the package remains stable for its current scope.
License in practice
MIT license is permissive, allowing use in commercial and private projects with minimal restrictions.
Quickstart
pip install pylint-protobuf
Add to pylintrc:
[MASTER]
load-plugins=pylint_protobuf
Then run:
pylint --load-plugins=pylint_protobuf your_code.py
Requires protobuf-generated Python modules (_pb2.py files) to already exist in your project; the plugin does not generate them.
Verify before relying
- Whether the plugin works with recent versions of pylint and protobuf beyond what its dormant status suggests.
- Coverage of protobuf features beyond the documented known limitations (extensions, HasExtension, ClearExtension).
- Whether Python 3.8 minimum support still holds or if newer Python versions are required by current pylint/protobuf versions.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — astroid, pylint, protobuf |
| Maintenance | dormant — 978 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 114,004/month — #12,319 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pylint_protobuf-0.22.0-py2.py3-none-any.whl
Keywords: pylint, plugin, protobuf
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
setuptools-protobufA setuptools plugin that automates compilation…
permissive · top 15,000 on PyPI
hatch-protobufA Hatch build plugin that generates Python…
copyleft · top 15,000 on PyPI
mypy-protobufGenerates mypy-compatible stub files (.pyi)…
permissive · top 5,000 on PyPI
pylint-per-file-ignoresA pylint plugin that lets you specify which…
permissive · top 15,000 on PyPI
pylint-odooA Pylint plugin that adds Odoo-specific code…
agpl · top 15,000 on PyPI
pylint-pydanticA Pylint plugin that extends Pylint's…
copyleft · top 5,000 on PyPI
pylint-djangoA Pylint plugin that improves static analysis…
copyleft · top 5,000 on PyPI
pylint-actionsA Pylint plugin that formats linting output as…
permissive · top 15,000 on PyPI
pylint-pytestA Pylint plugin that suppresses false-positive…
permissive · top 15,000 on PyPI
protoletariatProtoletariat rewrites Python imports generated…
permissive · top 5,000 on PyPI