pyrequire


Namepyrequire JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryA bunch of decorators for checking specific requirements of Python functions at runtime
upload_time2025-07-15 20:15:08
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseBSD 3-Clause License
keywords decorators requirements utilities
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <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
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyrequire",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "decorators, requirements, utilities",
    "author": null,
    "author_email": "Keurfon Luu <keurfonluu@outlook.com>",
    "download_url": "https://files.pythonhosted.org/packages/e5/3b/c4a84ba4a470cd074be67a0d3d1a275ab7a5983c1d5778604bdd2902807b/pyrequire-0.1.0.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\r\n   <h1 align=\"center\"><b>PyRequire</b></h1>\r\n</p>\r\n\r\n[![License](https://img.shields.io/badge/license-BSD--3--Clause-green)](https://github.com/keurfonluu/pyrequire/blob/master/LICENSE)\r\n[![Stars](https://img.shields.io/github/stars/keurfonluu/pyrequire?style=flat&logo=github)](https://github.com/keurfonluu/pyrequire)\r\n[![Pyversions](https://img.shields.io/pypi/pyversions/pyrequire.svg?style=flat)](https://pypi.org/pypi/pyrequire/)\r\n[![Version](https://img.shields.io/pypi/v/pyrequire.svg?style=flat)](https://pypi.org/project/pyrequire)\r\n[![Downloads](https://pepy.tech/badge/pyrequire)](https://pepy.tech/project/pyrequire)\r\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat)](https://github.com/psf/black)\r\n\r\nA bunch of decorators for checking specific requirements of Python functions at runtime.\r\n\r\n## Features\r\n\r\n- Simple decorators to enforce required Python version or package versions at runtime\r\n- Flexible version specification using standard comparison operators (e.g., >=, <, ==)\r\n- Lightweight, with no runtime dependencies\r\n- Helps ensure reproducibility and compatibility in code execution\r\n\r\n## Installation\r\n\r\nThe recommended way to install **pyrequire** is through the Python Package Index:\r\n\r\n```bash\r\npip install pyrequire --user\r\n```\r\n\r\nOtherwise, clone and extract the package, then run from the package location:\r\n\r\n```bash\r\npip install . --user\r\n```\r\n\r\nTo test the integrity of the installed package, check out this repository and run:\r\n\r\n```bash\r\npytest\r\n```\r\n\r\n## Examples\r\n\r\n```python\r\nfrom pyrequire import require_package, require_python\r\n\r\n@require_python(\">=3.9\")\r\n@require_package(\"foo>=1.2.3\")\r\ndef bar():\r\n    return\r\n```\r\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License",
    "summary": "A bunch of decorators for checking specific requirements of Python functions at runtime",
    "version": "0.1.0",
    "project_urls": {
        "Code": "https://github.com/keurfonluu/pyrequire",
        "Homepage": "https://github.com/keurfonluu/pyrequire",
        "Issues": "https://github.com/keurfonluu/pyrequire/issues"
    },
    "split_keywords": [
        "decorators",
        " requirements",
        " utilities"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ce3755ccc93039a6b8d64aa062b55e0c7ed9cdee1b3898f8a090f762a6f7de31",
                "md5": "ca9119f739b3d261940372fd3cf9f54b",
                "sha256": "47e0309352eb1d02f4251c6c65e9e4235ee9fc13f9cc07a074ef3d747956705f"
            },
            "downloads": -1,
            "filename": "pyrequire-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ca9119f739b3d261940372fd3cf9f54b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 5426,
            "upload_time": "2025-07-15T20:15:07",
            "upload_time_iso_8601": "2025-07-15T20:15:07.232306Z",
            "url": "https://files.pythonhosted.org/packages/ce/37/55ccc93039a6b8d64aa062b55e0c7ed9cdee1b3898f8a090f762a6f7de31/pyrequire-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e53bc4a84ba4a470cd074be67a0d3d1a275ab7a5983c1d5778604bdd2902807b",
                "md5": "cbfba030a5aaac9352bd267add1e2629",
                "sha256": "71fc24134cf3ab76058036bbcdc3b67a199612b5316ca1ea12d97734d1dca3fa"
            },
            "downloads": -1,
            "filename": "pyrequire-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cbfba030a5aaac9352bd267add1e2629",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 5476,
            "upload_time": "2025-07-15T20:15:08",
            "upload_time_iso_8601": "2025-07-15T20:15:08.260907Z",
            "url": "https://files.pythonhosted.org/packages/e5/3b/c4a84ba4a470cd074be67a0d3d1a275ab7a5983c1d5778604bdd2902807b/pyrequire-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-15 20:15:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "keurfonluu",
    "github_project": "pyrequire",
    "github_not_found": true,
    "lcname": "pyrequire"
}
        
Elapsed time: 0.86919s