Skip to content

JavierLuna/datastorm

Repository files navigation

Datastorm

Python versions PyPI version Documentation Status CircleCI

What is it?

Datastorm is an attempt to make your datastore experience painless.

How am I going to do that? I'll show you!

How to

Connect to DataStore

from datastorm.datastorm import DataStorm

datastorm = DataStorm("example-gcloud-project")

Define an entity

from datastorm import fields
class EntityName(datastorm.DSEntity): 
    __kind__ = "EntityName"
    foo = fields.StringField(default="Default values rules!")

Query for a field

results = EntityName.query.filter(EntityName.foo == "bar").all()

for result in results:
    do_stuff(result) # type(result) is EntityName

Query several filters

from datastorm.filter import Filter
results = EntityName.query.filter(EntityName.foo == "bar").filter(Filter('numeric_foo', '<', 2)).all()

for result in results:
    do_stuff(result) # type(result) is EntityName

Create or update entity

e = EntityName()
e.foo = "bar"
e.save()
e.foo = "rab"
e.set('bar', True)
e.save()

Batch create/update entities

datastorm.save_multi(entity_list)

Install

pip install datastorm

Test

To be able to run the tests, you'll need Docker installed. Then:

make docker-test

To be able to run the tests without Docker, please visit the documentation.

Disclaimer

Fork from OrbitalAds/dittostore, which I also created.

About

A simple and intuitive Google Datastore ODM

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published