Skip to content

furkanonder/glassjar

Repository files navigation

Pickled database that provide Object-Relational Mapper.

Actions Status GitHub issues GitHub stars GitHub license Downloads Supported Versions

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!

About

Pickled database that provide ORM.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages