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.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pychoice-0.1.1-py2.py3-none-any.whl (3.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pychoice-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pychoice-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d597dd02310fa28520b2978f9f30dff416e08ed712d768231e49724bcf6f6b98
MD5 731d9a11a73d35620216adf8045b4eec
BLAKE2b-256 8f2ad92566bc7288ff919c455c9f3cc1c99894fa48ba8a6cb96dff2619ecccbe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page