mopper
A lightweight Python linter built on the standard library's ast module, with zero runtime dependencies.
mopper doesn't aim to replace tools like Flake8 or Pylint. Instead, it focuses on a small set of practical checks that catch common mistakes such as unused imports, mutable default arguments, bare except clauses, unreachable code, and more.
Installation
pip install mopper
Usage
mopper path/to/file.py
mopper path/to/project/
mopper . --select B001,B003
mopper . --format json
Rules
| Code | Check |
|---|---|
| B001 | Unused import |
| B002 | Bare except clause |
| B003 | Mutable default argument |
| B004 | Comparing to None, True, or False with == instead of is |
| B005 | Unreachable code after return, raise, break, or continue |
| B006 | Line longer than 100 characters |
Why mopper?
mopper was built from scratch to understand how Python static analysis works internally using only the standard library. It demonstrates how a practical linter can be implemented with ast.NodeVisitor and a simple, extensible rule system.
License
MIT
Metadata
Release files for mopper 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mopper-0.1.1.tar.gz | 6.6 kB | Without provenance | Details for mopper-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mopper-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for mopper-0.1.1-py3-none-any.whl |
Total release size: 15.3 kB
Release files / mopper-0.1.1.tar.gz
| Download URL | mopper-0.1.1.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
090aad9c708f0b46fead5578d4a236b751275c1a28d114f4ffc737a40f5aa0b9
|
|
BLAKE2b-256 checksum How to use checksums |
d10452f0a9b9375661b3e5f5e9b9b1ee4c62bec8081661408f0363ce9cf18d54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / mopper-0.1.1-py3-none-any.whl
| Download URL | mopper-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1859bad184d8e77d1025a0b0c39ee2b0fb3bde99f534eb8ae1b738271cffcb6
|
|
BLAKE2b-256 checksum How to use checksums |
625234f0ce8f2ad36e1b4d25f6c7422be636fd990784d9b6060535eeeeeb5d7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for mopper 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.