Metadata-Version: 2.1
Name: more-decorators
Version: 0.1.1
Summary: Python decorators library
License: MIT
Author: Leo Sin
Author-email: leo.sin@my.cityu.edu.hk
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Provides-Extra: docs
Requires-Dist: myst-parser (>=2.0.0,<3.0.0) ; extra == "docs"
Requires-Dist: sphinx (>=7.2.6,<8.0.0) ; extra == "docs"
Requires-Dist: sphinx-autoapi (>=3.0.0,<4.0.0) ; extra == "docs"
Requires-Dist: sphinx-pyproject (>=0.3.0,<0.4.0) ; extra == "docs"
Requires-Dist: sphinx-rtd-theme (>=2.0.0,<3.0.0) ; extra == "docs"
Requires-Dist: sphinxcontrib-apidoc (>=0.5.0,<0.6.0) ; extra == "docs"
Description-Content-Type: text/markdown

# Python More Decorators

Python More Decorators is a handy library to simplify your code with a collection of useful decorators.

- Works with type checking (tested with `mypy`)

## Installation

### pip

```bash
pip install python-more-decorators
```

### poetry

```bash
poetry add python-more-decorators
```

## Features

### Evaluate runtime-default arguments

Sometimes we are just tired of polluting the function arguments declaration with `None` as `argument: Optional[MutableType] = None`.
Or, we have all been here: having `some_list_argument: list[T] = []` or `now: float = time.time()` in arguments.

The worst thing is that it still runs.

We now have:

```python
from more_decorators.runtime_defaults import evaluate_runtime_defaults, runtime_default

@evaluate_runtime_defaults
def foo(now: float = runtime_default(time.time)): # think of it like `now: float = time.time()`
                                                  # but evaluated every time upon function call
    return f"Unix Timestamp: {now}"
```

...and more to come.

## License

This library is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## Development

See [CONTRIBUTING.md](CONTRIBUTING.md)


