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)
There is also a flake8 plugin available that can be used to check purity violations in your codebase.
$ flake8 --select PURE file-or-directory
For more information on using flake8, you can refer to the official flake8 documentation.
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.
Release files for pure-validator 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pure_validator-0.3.0.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pure_validator-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.6 kB
Release files / pure_validator-0.3.0.tar.gz
| Download URL | pure_validator-0.3.0.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3e72e330f03edca5230bea593ccf055f59e74f72122930b40e5941ea8c03ceff
|
|
BLAKE2b-256 checksum How to use checksums |
008de36f6218ebec81e5e54450fa373e2ed054cbe903c7a37ba31e81086082a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.12
|
Release files / pure_validator-0.3.0-py3-none-any.whl
| Download URL | pure_validator-0.3.0-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eb16012b0b51a1372af21a4e881b7bfb55b8aa371318728c8e1b410f92af5a49
|
|
BLAKE2b-256 checksum How to use checksums |
0f4fc0dc8dfc6ef5cfb6e8a0fa819cc2a6658a119cc2dab5284a847b5e355879
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.12
|