Registry / testing / mr-proper

mr-proper

JSON →
library0.0.7pypypiunverified

Mr-proper is a static Python code analyzer that aims to identify whether functions are 'pure' or not, and to explain the reasons behind its conclusions. It's a highly experimental library with known edge cases, and its definition of purity is specific to its implementation. The latest version is 0.0.7, released in October 2021, indicating an irregular release cadence.

pip install mr-proper
INSTALL
IMPORT
SIG · MR-PROPER
M
mr-proper
testingpythonv0.0.7
Install
2.0s avg
Import
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.1MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.0s · import 0.000s · 20MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

is_function_pure
from mr_proper.utils import is_function_pure
from mr_propper.utils import is_function_pure

This quickstart demonstrates how to use `mr-proper` programmatically by parsing an AST node (a function definition) and checking its purity using `is_function_pure`. It shows both a pure and a non-pure function example.

import ast from mr_propper.utils import is_function_pure # Example of a pure function func_def_pure = ast.parse(''' def add_one(n: int) -> int: return n + 1 ''').body[0] is_pure, errors = is_function_pure(func_def_pure, with_errors=True) print(f"'add_one' is pure: {is_pure}, Errors: {errors}") # Example of a non-pure function func_def_not_pure = ast.parse(''' def print_amount_of_users(users_qs: list) -> None: print(f'Current amount of users is {len(users_qs)}') ''').body[0] is_pure, errors = is_function_pure(func_def_not_pure, with_errors=True) print(f"'print_amount_of_users' is pure: {is_pure}, Errors: {errors}")
mr-proper --version
Debug
Known issues
gotchaThe library is explicitly stated as 'very experimental and has a lot of edge cases'. Functions marked as pure might not be strictly pure by other definitions, though they are generally cleaner. Rely on its findings with caution.
fix
Thoroughly review code flagged as pure and understand `mr-proper`'s specific purity criteria. Do not solely rely on the tool for correctness without human review.
affects: All versions (0.0.1 - 0.0.7)
breakingThe PyPI package name is `mr-proper` (with a hyphen), but the import statement requires `mr_propper` (with an underscore and a double 'p'). Using `import mr_proper` will result in an `ImportError`.
fix
Always use `from mr_propper.utils import is_function_pure` or `import mr_propper` when importing.
affects: All versions (0.0.1 - 0.0.7)
gotchaThe command-line interface (CLI) for `mr-proper` currently does not support checking directories recursively; it only accepts individual Python file paths.
fix
To check multiple files or a project, you must iterate through files yourself or integrate the programmatic API into a custom script.
affects: All versions (0.0.1 - 0.0.7)
gotchaThe project's activity has been low, with the last release in October 2021. This might imply slower responses to issues, potential unaddressed bugs, or a lack of new features.
fix
Consider the maintenance status when planning long-term adoption. Review the GitHub issues and pull requests to gauge current community activity and maintainer responsiveness.
affects: All versions
Upgrade
Version history
0.0.7latest on PyPI · released Oct 27, 2021
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
mr-proper — pip install mr-proper · libregistry