Skip to main content

Purity validator for Python code.

Project description

Pure validator

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.

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

pure_validator-0.2.1.tar.gz (7.2 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.2.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pure_validator-0.2.1.tar.gz
Algorithm Hash digest
SHA256 162e6da7a1f8c67a9303fe87a2c936a40a0cc8c1c477ea4d17eb9fcded328b32
MD5 03015e07c52c2f69ceff8496038d9850
BLAKE2b-256 c5b9867fa695afa629cc5057971c0a10f27249cc41c8e7c622a550071ab0645a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pure_validator-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ddd424c279154de71d575cb895f3e16265a9e4e5099294fa35bd66e033a6d27
MD5 cc695aaacf1efca57853d262f2549e68
BLAKE2b-256 de251269a844b538f52f409b321f1c5df7da3cc59f1221a897ac28021bc08853

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