Container for dictionary-like validated data structures
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tg-option-container-0.4.0.tar.gz
.
File metadata
- Download URL: tg-option-container-0.4.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 406a683a2b93161297de82a8ee98fc3bab38db909c48d5456d0e9b10e4f08281 |
|
MD5 | 3cb4205e2f6a3c893b29b759f51eb5f7 |
|
BLAKE2b-256 | 86a5ed3451d065a43b28008cf9956e0284a056a6b0b7cfa699665ef792c204e5 |
File details
Details for the file tg_option_container-0.4.0-py2.py3-none-any.whl
.
File metadata
- Download URL: tg_option_container-0.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 044b4d171f29de18fac07161ec6de9e450e4295647bf89fe6d75ed1c16091ef0 |
|
MD5 | 7de37074b3f10fede7d22015cc84db41 |
|
BLAKE2b-256 | edb283df4bd75cd8c5d5384536def4b012820ff2a98790035e4744c766d4f67f |