Skip to main content

Container for dictionary-like validated data structures

Project description

Build Status Coverage Status PyPI Status

Container for dictionary-like validated data structures

Documentation is available on Read the Docs: http://tg-option-container.readthedocs.io

Getting started

Install tg-option-container:

pip install tg-option-container

Then use it in your project:

from tg_option_container import Option, OptionContainer


class Character(OptionContainer):
    props = [
        Option.string('name', None),
        Option.string('gender', None, choices=('M', 'N')),
    ]


john = Character(name='John Smith', gender='M')

# This will raise: tg_option_container.types.InvalidOption: Invalid choice x for option `gender`, choices are ('M', 'N').
mary = Character(name='Mary Smith', gender='x')

Development

You can run the tests by running tox in the top-level of the project.

Project details


Download files

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

Source Distribution

tg-option-container-0.4.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

tg_option_container-0.4.0-py2.py3-none-any.whl (10.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file tg-option-container-0.4.0.tar.gz.

File metadata

File hashes

Hashes for tg-option-container-0.4.0.tar.gz
Algorithm Hash digest
SHA256 406a683a2b93161297de82a8ee98fc3bab38db909c48d5456d0e9b10e4f08281
MD5 3cb4205e2f6a3c893b29b759f51eb5f7
BLAKE2b-256 86a5ed3451d065a43b28008cf9956e0284a056a6b0b7cfa699665ef792c204e5

See more details on using hashes here.

File details

Details for the file tg_option_container-0.4.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for tg_option_container-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 044b4d171f29de18fac07161ec6de9e450e4295647bf89fe6d75ed1c16091ef0
MD5 7de37074b3f10fede7d22015cc84db41
BLAKE2b-256 edb283df4bd75cd8c5d5384536def4b012820ff2a98790035e4744c766d4f67f

See more details on using hashes here.

Supported by

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