Skip to main content

mopper

PyPI Python License CI

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

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)

Source distribution for mopper 0.1.1
File Size Uploaded
mopper-0.1.1.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mopper 0.1.1
File Interpreter ABI Platform
mopper-0.1.1-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page