Metadata-Version: 2.4
Name: staticmodel
Version: 1.2.0
Summary: Static Models.
Home-page: https://github.com/wsmith323/staticmodel
Author: Warren A. Smith
Author-email: warren@wandrsmith.net
License: MIT
Keywords: static constant model enum django
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: summary

# StaticModel

**StaticModel** provides tools for modeling and working with tabular
constants.

## Quick Example

```pycon
>>> 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

- [User Guide](docs/user-guide.md)
    - [StaticModel classes](docs/user-guide.md#staticmodel-classes)
    - [Member access methods](docs/user-guide.md#member-access-methods)
    - [Sub-models](docs/user-guide.md#sub-models)
    - [Primitive representations](docs/user-guide.md#primitive-representations)
    - [Django model fields](docs/user-guide.md#django-model-fields)
    - [Django REST Framework serializer fields](docs/user-guide.md#django-rest-framework-serializer-fields)
- [Why StaticModel?](docs/rationale.md)

Read the full documentation:
https://staticmodel.readthedocs.org/en/latest.
