Skip to main content

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)

Uploaded Source

Built Distribution

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

staticmodel-1.2.0-py2.py3-none-any.whl (10.0 kB view details)

Uploaded Python 2Python 3

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

Hashes for staticmodel-1.2.0.tar.gz
Algorithm Hash digest
SHA256 91b77ab51481159e731c31fb8dc639ef70fa69b0f16abd3bcb8ab5fb3774ad12
MD5 00a00947292e474deb8b1b8b871d70ae
BLAKE2b-256 432154d44b96ad46d349fcb8f4b18a2e7f2f07eea9ce1a5340cc5bfb5819feda

See more details on using hashes here.

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

Hashes for staticmodel-1.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6463c76db86cdd95f54497fda47bcbb8881af2b99ece7e96b27187556d58e348
MD5 c81a73097b169ea39bfe5c70cb0b4e4e
BLAKE2b-256 61b546729664b70840ad0347436ed3c417d6beb6124b81d1acc496d0c3dd25af

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 files

1.1.5

2 files

1.1.4

2 files

1.1.3

1 file

1.1.2

1 file

1.1.1

1 file

1.1.0

1 file

1.0.0

1 file

0.6.1

1 file

0.6.0

1 file

0.5.0

1 file

0.4.1

1 file

0.4.0

1 file

0.3.3

1 file

0.3.2

1 file

0.3.1

1 file

0.3.0

1 file

0.2.0

1 file

0.1.7

1 file

0.1.6

1 file

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

Supported by

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