Skip to main content

Pickled database that provide Object-Relational Mapper.

Project description

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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glassjar-0.1.1.tar.gz (6.2 kB view hashes)

Uploaded Source

Built Distribution

glassjar-0.1.1-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page