Skip to main content

An utility adds code readability to your application and/or API, Code is documentation!

Project description

An utility adds code readability to your application and/or API, Code is documentation!

Install

pip install pychoice

Example

from pychoice import Choice

Status = Choice(
    (0, 'item0'),
    (1, 'item1'),
    (2, 'item2')
)

assert Status('item0') == 0
assert Status('item0', 'item1') == [0, 1]

assert Status[0] == 'item0'
assert Status[0, 1] == ['item0', 'item1']
assert Status[...] == ['item0', 'item1', 'item2']

assert Status.exclude('item0') == [1, 2]
assert Status.pairs('item0', 'item2') == [(0, 'item0'), (2, 'item2')]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pychoice-0.1.1-py2.py3-none-any.whl (3.2 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Aug 10, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page