skillfed

mr-proper

Static Python code analyzer, that tries to check if functions in code are pure or not and why.

mr-proper v0.0.7 360.1K downloads/30d#7,246 on PyPI19
Permissive license MIT Abandoned released

What it is and what it does

mr. Proper analyzes Python function definitions via AST inspection to assess whether they conform to a set of purity heuristics: no blacklisted calls (like print), no global state access, no argument mutation, no local imports, no forbidden argument types (like ORM objects), and only calls to other pure functions. It provides both a CLI tool and a programmatic API (is_function_pure) to report violations.

The tool is explicitly experimental and acknowledges edge cases—functions marked pure may not actually be pure, but the analysis tends to identify cleaner code. It requires fully type-annotated functions and no dynamic calls. With an abandoned status since 2021 and no active maintenance, it is suitable only for exploratory code quality checks or legacy codebases where the tool was already integrated.

Use it for:

  • Audit existing Python codebases to identify which functions have no side effects and could be refactored for testability.
  • Enforce functional programming patterns in a team by checking that utility functions remain pure during code review.
  • Detect accidental use of global state or ORM objects in functions intended to be pure calculations.
  • Analyze legacy code to find candidates for memoization or parallelization based on purity guarantees.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

mr. Proper is a static code analyzer that examines Python functions to determine whether they are pure—free from side effects, global state mutations, and forbidden operations—and reports why they fail purity checks.

No, unless you are maintaining legacy code that already uses it. The project is archived and unmaintained since 2021, with no bug fixes or Python version updates forthcoming. The purity heuristics are experimental and produce false positives. For new projects, consider actively maintained alternatives instead.

Install

mr-proper on PyPI

pip

pip install mr-proper

uv

uv add mr-proper

poetry

poetry add mr-proper

Installing mr-proper

Before you install

Low install friction with four lightweight runtime dependencies. However, the project is archived and abandoned since 2021, so maintenance and bug fixes are not expected.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions, making it safe to use in most projects without legal concern.

Quickstart

pip install mr_proper

import ast
from mr_proper.utils import is_function_pure
funcdef = ast.parse('def add_one(n: int) -> int:\n    return n + 1').body[0]
is_function_pure(funcdef)

Functions must be fully type-annotated; no dynamic calls supported.

Verify before relying

  • How accurately the purity heuristics identify truly pure functions in practice, given the disclaimer about edge cases and false positives.
  • Whether the tool remains compatible with Python versions beyond 3.9 despite being last released in 2021.

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 4 — click, setuptools, stdlib-list, typing-extensions
Maintenance abandoned — 1,752 days since the last release
Last repo commit (repository archived)
First released
Downloads 360,139/month — #7,246 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mr_proper-0.0.7-py3-none-any.whl

Keywords: static-analyzer, pure-function

Development Status :: 3 - AlphaEnvironment :: ConsoleOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

static code analyzer pythonpure function checkercode quality analysisfunction purity detectionside effect detectionpython code linterast analysis tool
static-analysisabandoned

More Python Modules packages