glassjar 0.1.1

Creator: rpa-with-ash

Last updated:

Add to Cart

Description:

glassjar 0.1.1

Pickled database that provide Object-Relational Mapper.







Motivation
Glassjar is a database that provides a storage mechanism based on pickled Python objects
with ORM.
Installation
glassjar can be installed by running pip install glassjar.
Example
>>> from glassjar.model import Model
>>>
>>> class Item(Model):
... name: str
... attrs: dict
...
>>> item = Item.records.create(name="item", attrs={"color": "red", "shape":"rectangle"})
>>> item.as_dict()
{'name': 'item', 'attrs': {'color': 'red', 'shape': 'rectangle'}}
>>> item2 = Item.records.create(name="item 2", attrs={"color": "blue", "shape":"triangle"})
>>> Item.records.first()
Item(name='item', attrs={'color': 'red', 'shape': 'rectangle'})
>>> Item.records.last()
Item(name='item 2', attrs={'color': 'blue', 'shape': 'triangle'})
>>>

Check out our documentation to learn more!

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.