{"id":6725,"library":"mr-proper","title":"mr-proper","description":"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.","status":"active","version":"0.0.7","language":"en","source_language":"en","source_url":"https://github.com/best-doctor/mr_proper","tags":["static-analysis","code-quality","purity-checking","experimental"],"install":[{"cmd":"pip install mr-proper","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"The PyPI package is 'mr-proper', but the import path uses 'mr_propper' (double 'p'). Importing from 'mr_proper' will result in an ImportError.","wrong":"from mr_proper.utils import is_function_pure","symbol":"is_function_pure","correct":"from mr_propper.utils import is_function_pure"}],"quickstart":{"code":"import ast\nfrom mr_propper.utils import is_function_pure\n\n# Example of a pure function\nfunc_def_pure = ast.parse('''\ndef add_one(n: int) -> int:\n    return n + 1\n''').body[0]\n\nis_pure, errors = is_function_pure(func_def_pure, with_errors=True)\nprint(f\"'add_one' is pure: {is_pure}, Errors: {errors}\")\n\n# Example of a non-pure function\nfunc_def_not_pure = ast.parse('''\ndef print_amount_of_users(users_qs: list) -> None:\n    print(f'Current amount of users is {len(users_qs)}')\n''').body[0]\n\nis_pure, errors = is_function_pure(func_def_not_pure, with_errors=True)\nprint(f\"'print_amount_of_users' is pure: {is_pure}, Errors: {errors}\")","lang":"python","description":"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."},"warnings":[{"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.","message":"The 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.","severity":"gotcha","affected_versions":"All versions (0.0.1 - 0.0.7)"},{"fix":"Always use `from mr_propper.utils import is_function_pure` or `import mr_propper` when importing.","message":"The 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`.","severity":"breaking","affected_versions":"All versions (0.0.1 - 0.0.7)"},{"fix":"To check multiple files or a project, you must iterate through files yourself or integrate the programmatic API into a custom script.","message":"The command-line interface (CLI) for `mr-proper` currently does not support checking directories recursively; it only accepts individual Python file paths.","severity":"gotcha","affected_versions":"All versions (0.0.1 - 0.0.7)"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}