Condition Chain
===============
Process a series of conditional judgement with a chained call.
Example
-------
>>> from condition_chain import Condition
>>> condition = Condition(1).be(2).equal(2.0 - 2)\
.differ('a').instance_of(str).expect(lambda x: x, 1)
>>> print(condition.result(), condition.success, condition.failures, sep='\n')
False
[('be', 2), ('equal', 0.0), ('differ', 'a'), ('instance_of', 'str'), ('expect', ('<lambda>', 1))]
[('be', 2), ('equal', 0.0), ('instance_of', 'str')]
>>> condition = Condition([1,2,3]).contain(1).have('append').hold(3)
True
[('contain', 1), ('have', 'append'), ('hold', 3)]
[]
Install
-------
.. code-block:: shell
pip install condition_chain
Author
------
Yixian Du (duyixian1234@outlook.com)
Metadata
Release files for condition-chain 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| condition_chain-1.0.0.tar.gz | 3.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| condition_chain-1.0.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 7.5 kB
Release files / condition_chain-1.0.0.tar.gz
| Download URL | condition_chain-1.0.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62ff3030722cb34894d74b262e5b5bf1be66e8ad8487304799ee2424be584934
|
|
BLAKE2b-256 checksum How to use checksums |
5048219e152013cb80869d97a6f35929781997d015c514bc977fccfa55710c7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / condition_chain-1.0.0-py2.py3-none-any.whl
| Download URL | condition_chain-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
9c4c58715c824b27d29d7962c9718a9ac57a7bb148dd2915a3700b38991dd22b
|
|
BLAKE2b-256 checksum How to use checksums |
5b671b4b53932f0abca94551456b9f1e5bfe3092efd2bf1eba6fda9ac49edaa9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |