Purity validator for Python code.
Project description
Pure validator
Purity validator for Python code.
Overview
Pure validator is a static analysis tool for checking the purity of Python functions and modules. It analyzes Python source code and reports on side effects, global state usage, and other purity-related concerns.
Suppose you have the following code:
def impure_function(): # pragma: pure
print("This is impure!")
Running the purity checker, will report an error similar to:
example.py:3: Function 'impure_function' is marked as pure but has side effects (print statement)
Features
- Recursively analyzes Python files in directories
- Reports purity violations and messages
- CLI and module entry point (
python -mpure_validator) - Easy integration with CI/CD
Installation
You can install Pure via pip:
$ pip install pure-validator
Usage
Command Line
$ pure-validator file-or-directory
Contributing
Contributions are welcome! Please open issues or pull requests on GitHub.
License
This project is licensed under the terms of the license found in the LICENSE file.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pure_validator-0.2.0.tar.gz.
File metadata
- Download URL: pure_validator-0.2.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
293690720aed22eb5484e17fa418694546efbd99368e9d54e49be3aa5bc4af95
|
|
| MD5 |
116edfa5d05e7ee230cb83659562c344
|
|
| BLAKE2b-256 |
577e0cb44a780191c92d8ed7aa7f32f4562bafdaada7b8c8870b767b25c9d2c7
|
File details
Details for the file pure_validator-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pure_validator-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f53112d57ae0bee25cb1851091ff29d40ce2d7995445a0f876674c720d28f1b6
|
|
| MD5 |
b9528a4273499fcee45e7d1204ba3440
|
|
| BLAKE2b-256 |
13778120201008f2c8c1d5d8fbef5f169ed31d92244bd0ab60fb6fcb06df4058
|