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 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 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.0.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.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

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

Hashes for pure_validator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9f348fef44b7ac3893577eaef5526db0f89b752039fbb66702f2b151d9335bff
MD5 9b4ffd18e2e3d3a4ca6200bcf7c2340c
BLAKE2b-256 02d5bee10aa4cba52231ee298c804d394966e89d51dfd33f384100bc7c87e8c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pure_validator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc0f39322a2f2ee562810f965b957607be7becda43ec98d195a6e921e1095004
MD5 e40aa11dc25496d64b00f18270634923
BLAKE2b-256 68462367b374afb69bc0beaf3370ebfdc5290677bfa9f123c27a6ffa5dc2197c

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