Skip to main content

Purity validator for Python code.

Project description

Pure

Purity validator for Python code.

GitHub

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 via pip:

pip install pure_validator

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 code
  • pure_validator/tests/ - Test suite
  • pyproject.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

pure_validator-0.1.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pure_validator-0.1.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file pure_validator-0.1.1.tar.gz.

File metadata

  • Download URL: pure_validator-0.1.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.12

File hashes

Hashes for pure_validator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e9fa857aa8a9652526f0c44f2c62c84688340eed97b507f75d93c67191ac838a
MD5 53b9ce5c343bb218920600a82e134cef
BLAKE2b-256 0467045d8d7c16888db22da03ec78330fb14011b4f20087ee2753ede22ed5e15

See more details on using hashes here.

File details

Details for the file pure_validator-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pure_validator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1337a24c97c635e465c07366630f901c83f2b9586ef036ce78e29cdb46a3e69e
MD5 278f591cd328b8c834de87b83bcb7484
BLAKE2b-256 ff73b4a0b720f1bb5f425d1920549ac832df4975a7f4c631c8378e6ca61d85ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page