Metadata-Version: 2.3
Name: pure-validator
Version: 0.3.0
Summary: Purity validator for Python code.
Author: Johan Dahlin
Author-email: Johan Dahlin <jdahlin@gmail.com>
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: ruff>=0.12.10 ; extra == 'dev'
Requires-Dist: flake8>=7.3.0 ; extra == 'flake8'
Requires-Python: >=3.12
Project-URL: Homepage, https://github.com/jdahlin/pure
Project-URL: Repository, https://github.com/jdahlin/pure
Provides-Extra: dev
Provides-Extra: flake8
Description-Content-Type: text/markdown

# Pure validator

Purity validator for Python code.

[![GitHub](https://img.shields.io/github/stars/jdahlin/pure?style=social)](https://github.com/jdahlin/pure)

## 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:

```python
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](https://flake8.pycqa.org/) plugin available that can be used to check purity violations in your codebase.

```bash
$ flake8 --select PURE file-or-directory
```

For more information on using flake8, you can refer to the official [flake8](https://flake8.pycqa.org/) 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:

```bash
$ pip install pure-validator
```

## Usage

### Command Line


```bash
$ pure-validator file-or-directory
```

## Contributing

Contributions are welcome! Please open issues or pull requests on [GitHub](https://github.com/jdahlin/pure).

## License

This project is licensed under the terms of the license found in the `LICENSE` file.
