StaticModel
StaticModel provides tools for modeling and working with tabular constants.
Quick Example
>>> from staticmodel import StaticModel
>>>
>>>
>>> class AnimalType(StaticModel):
... _field_names = 'name', 'description', 'has_legs'
...
... DOG = 'Dog', "Man's best friend", True
... SNAKE = 'Snake', "Man's slithering companion", False
...
... def walk(self):
... if self.has_legs:
... return '{} walking...'.format(self.name)
... return "{} can't walk.".format(self.name)
...
>>> AnimalType.DOG.walk()
'Dog walking...'
>>> AnimalType.members.get(name='Snake')
<AnimalType.SNAKE: name='Snake', description="Man's slithering companion", has_legs=False>
Documentation
Read the full documentation: https://staticmodel.readthedocs.org/en/latest.
Metadata
Release files for staticmodel 1.2.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 | |
|---|---|---|---|
| staticmodel-1.2.0.tar.gz | 10.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| staticmodel-1.2.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 20.8 kB
Release files / staticmodel-1.2.0.tar.gz
| Download URL | staticmodel-1.2.0.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
91b77ab51481159e731c31fb8dc639ef70fa69b0f16abd3bcb8ab5fb3774ad12
|
|
BLAKE2b-256 checksum How to use checksums |
432154d44b96ad46d349fcb8f4b18a2e7f2f07eea9ce1a5340cc5bfb5819feda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / staticmodel-1.2.0-py2.py3-none-any.whl
| Download URL | staticmodel-1.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
6463c76db86cdd95f54497fda47bcbb8881af2b99ece7e96b27187556d58e348
|
|
BLAKE2b-256 checksum How to use checksums |
61b546729664b70840ad0347436ed3c417d6beb6124b81d1acc496d0c3dd25af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|