Metadata-Version: 2.4
Name: pyrequire
Version: 0.2.0
Summary: A bunch of decorators for checking specific requirements of Python functions at runtime
Author-email: Keurfon Luu <keurfonluu@outlook.com>
License: BSD 3-Clause License
Project-URL: Homepage, https://github.com/keurfonluu/pyrequire
Project-URL: Code, https://github.com/keurfonluu/pyrequire
Project-URL: Issues, https://github.com/keurfonluu/pyrequire/issues
Keywords: decorators,requirements,utilities
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Natural Language :: English
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

<p align="center">
   <h1 align="center"><b>PyRequire</b></h1>
</p>

[![License](https://img.shields.io/badge/license-BSD--3--Clause-green)](https://github.com/keurfonluu/pyrequire/blob/master/LICENSE)
[![Stars](https://img.shields.io/github/stars/keurfonluu/pyrequire?style=flat&logo=github)](https://github.com/keurfonluu/pyrequire)
[![Pyversions](https://img.shields.io/pypi/pyversions/pyrequire.svg?style=flat)](https://pypi.org/pypi/pyrequire/)
[![Version](https://img.shields.io/pypi/v/pyrequire.svg?style=flat)](https://pypi.org/project/pyrequire)
[![Downloads](https://pepy.tech/badge/pyrequire)](https://pepy.tech/project/pyrequire)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat)](https://github.com/psf/black)

A bunch of decorators for checking specific requirements of Python functions at runtime.

## Features

- Simple decorators to enforce required Python version or package versions at runtime
- Flexible version specification using standard comparison operators (e.g., >=, <, ==)
- Lightweight, with no runtime dependencies
- Helps ensure reproducibility and compatibility in code execution

## Installation

The recommended way to install **pyrequire** is through the Python Package Index:

```bash
pip install pyrequire --user
```

Otherwise, clone and extract the package, then run from the package location:

```bash
pip install . --user
```

To test the integrity of the installed package, check out this repository and run:

```bash
pytest
```

## Examples

```python
from pyrequire import require_package, require_python

@require_python(">=3.9")
@require_package("foo>=1.2.3")
def bar():
    return
```
