Datastorm is an attempt to make your datastore experience painless.
How am I going to do that? I'll show you!
from datastorm.datastorm import DataStorm
datastorm = DataStorm("example-gcloud-project")
from datastorm import fields
class EntityName(datastorm.DSEntity):
__kind__ = "EntityName"
foo = fields.StringField(default="Default values rules!")
results = EntityName.query.filter(EntityName.foo == "bar").all()
for result in results:
do_stuff(result) # type(result) is EntityName
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
e = EntityName()
e.foo = "bar"
e.save()
e.foo = "rab"
e.set('bar', True)
e.save()
datastorm.save_multi(entity_list)
pip install datastorm
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.
Fork from OrbitalAds/dittostore, which I also created.