Metadata-Version: 2.4
Name: RSDecorator
Version: 0.1.0
Summary: An alternative to @decorator which allows you to easily fiddle with pre-resolved arguments, before transferring control to the wrapped function.
Author: Pascal Chambon
License-Expression: MIT
Project-URL: Homepage, https://github.com/pakal/rsdecorator
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: decorator
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Dynamic: license-file

# RSDecorator

An alternative to `@decorator` which allows you to easily fiddle with pre-resolved arguments, before transferring control to the wrapped function.

See the project repository: https://github.com/pakal/rsdecorator

## Installation

```bash
pip install RSDecorator
```

## Example

```python
from rsdecorator import resolving_decorator

@resolving_decorator
def inject_session(func, **all_kwargs):
    if not all_kwargs["session"]:
        all_kwargs["session"] = "<SESSION>"
    return func(**all_kwargs)

@inject_session
def myfunc(session):
    return session

assert myfunc(None) == myfunc(session=None) == "<SESSION>"
assert myfunc("<stuff>") == myfunc(session="<stuff>") == "<stuff>"
```

## Development

```bash
pip install -e .[test]
pytest
```

Run the full test matrix across supported Python versions with:

```bash
tox
```
