Metadata-Version: 2.1
Name: checksignature
Version: 0.1.1
Summary: a function decorator for enforcing function signatures
Home-page: https://github.com/withtwoemms/checksignature
Author: Emmanuel I. Obi
Maintainer: Emmanuel I. Obi
Maintainer-email: withtwoemms@gmail.com
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Description-Content-Type: text/markdown
License-File: LICENSE

# checksignature
> a function decorator for enforcing function signatures

[![tests](https://github.com/withtwoemms/checksignature/workflows/tests/badge.svg)](https://github.com/withtwoemms/checksignature/actions?query=workflow%3Atests)
[![publish](https://github.com/withtwoemms/checksignature/workflows/publish/badge.svg)](https://github.com/withtwoemms/checksignature/actions?query=workflow%3Apublish)
[![codecov](https://codecov.io/gh/withtwoemms/checksignature/branch/main/graph/badge.svg?token=95KK3WG5QW)](https://codecov.io/gh/withtwoemms/checksignature)

# Setup
Install build dependencies.
```
pip install -r requirements
```
Run [`nox`](https://nox.thea.codes/en/stable/) to build, install, and run `checksignature` tests.

# Usage

Decorate any funciton with `@checksignature`.
```python
@checksignature
def function(a: str, b: int, c, *args: int, **kwargs: int)::
    return a, b, c, args, kwargs
```
Upon invocation of `function`, the signature check is evaluated.
```python
function('one', 2, 3.0, 1, 2, 3, **{'four': 4})   #=> functions as usual--no problem.
function('one', 2, 3.0, 1, 2, 3, **{'four': 4.0}) #=> raises a TypeError
function('one', 2, 'x', 1, 2, 3, **{'four': 4})   #=> raises a TypeError
```
