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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
staticmodel-1.2.0.tar.gz
(10.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file staticmodel-1.2.0.tar.gz.
File metadata
- Download URL: staticmodel-1.2.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91b77ab51481159e731c31fb8dc639ef70fa69b0f16abd3bcb8ab5fb3774ad12
|
|
| MD5 |
00a00947292e474deb8b1b8b871d70ae
|
|
| BLAKE2b-256 |
432154d44b96ad46d349fcb8f4b18a2e7f2f07eea9ce1a5340cc5bfb5819feda
|
File details
Details for the file staticmodel-1.2.0-py2.py3-none-any.whl.
File metadata
- Download URL: staticmodel-1.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6463c76db86cdd95f54497fda47bcbb8881af2b99ece7e96b27187556d58e348
|
|
| MD5 |
c81a73097b169ea39bfe5c70cb0b4e4e
|
|
| BLAKE2b-256 |
61b546729664b70840ad0347436ed3c417d6beb6124b81d1acc496d0c3dd25af
|