Purity validator for Python code.
Project description
Pure
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.
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 using uv:
uv pip install -e .
Or build a wheel:
uv build
Usage
Command Line
Analyze a single file:
python -mpure_validator path/to/file.py
Analyze all Python files in a directory (recursively):
python -mpure_validator path/to/directory
As a Library
You can also use Pure programmatically:
from pure_validator.main import check_file
messages = check_file("path/to/file.py")
for msg in messages:
print(msg)
Project Structure
pure_validator/- Main source codepure_validator/tests/- Test suitepyproject.toml- Project metadata and build configuration
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.1.0.tar.gz.
File metadata
- Download URL: pure_validator-0.1.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 |
9f348fef44b7ac3893577eaef5526db0f89b752039fbb66702f2b151d9335bff
|
|
| MD5 |
9b4ffd18e2e3d3a4ca6200bcf7c2340c
|
|
| BLAKE2b-256 |
02d5bee10aa4cba52231ee298c804d394966e89d51dfd33f384100bc7c87e8c6
|
File details
Details for the file pure_validator-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pure_validator-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc0f39322a2f2ee562810f965b957607be7becda43ec98d195a6e921e1095004
|
|
| MD5 |
e40aa11dc25496d64b00f18270634923
|
|
| BLAKE2b-256 |
68462367b374afb69bc0beaf3370ebfdc5290677bfa9f123c27a6ffa5dc2197c
|