Skip to content

JavierLuna/datastorm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c1876cd · Nov 2, 2019

History

74 Commits
Nov 2, 2019
Aug 4, 2019
Nov 2, 2019
Nov 2, 2019
Oct 30, 2019
Nov 2, 2019
Jul 21, 2019
Nov 1, 2019
Jul 22, 2019
Sep 9, 2018
Oct 6, 2019
Nov 2, 2019
Aug 4, 2019
Nov 2, 2019
Oct 30, 2019
Jul 23, 2019
Nov 2, 2019
Nov 2, 2019
Nov 2, 2019

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