pontos.models package¶
- exception pontos.models.ModelError¶
Bases:
PontosError
Errors raised for Models
- class pontos.models.Model¶
Base class for models
- classmethod from_dict(data)¶
Create a model from a dict
Example
model = Model.from_dict({ "id": 123, "node_id": "abcde", "created_at": "2017-07-08T16:18:44-04:00", "updated_at": "2017-07-08T16:18:44-04:00", })
- class pontos.models.StrEnum(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
An Enum that provides str like behavior
- pontos.models.dotted_attributes(obj, data)¶
Set dotted attributes on an object
Example
class Foo: '''Some class''' foo = Foo() attrs = {"bar": 123, "baz": 456} foo = dotted_attributes(foo, attrs) print(foo.bar, foo.baz)
- Return type:
Any