Metadata-Version: 2.1
Name: ycontract
Version: 0.1.4
Summary: Python library for contracts testing
Home-page: https://gitlab.com/yassu/ycontract.py
License: Apache-2.0
Keywords: contract,test
Author: yassu
Author-email: yasu0320.dev@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Software Development :: Libraries
Project-URL: Repository, https://gitlab.com/yassu/ycontract.py
Description-Content-Type: text/markdown

ycontract
================================================================================

Python library for contracts testing.

This library provides functions for precondition(`prev_contract`) and postcondition(`ret_contract`).

How to install
--------------------------------------------------------------------------------

``` sh
$ pip install ycontract
```

Example
--------------------------------------------------------------------------------

Example files are [here](https://gitlab.com/yassu/ycontract.py/-/blob/master/tests/test_contract.py)(test files)

Main example is

``` python
from ycontract import prev_contract, ret_contract

@prev_contract(lambda a, b: a * b > 0)
def add(a, b, c, d=2, e=3):
    return a + b + c + d + e


@ret_contract(lambda res: res > 0)
def sub(a, b):
    return a - b
```

And if you want to be disable,

``` python
ycontract.SYS_STATE.disable()
```

LICENSES
--------------------------------------------------------------------------------

[Apache 2.0](https://gitlab.com/yassu/ycontract.py/-/blob/master/LICENSE)

