dat
datastorm
pypi i datastorm
dat

datastorm

A simple and intuitive Google Datastore ODM

by Javier Luna Molina

0.0.0a8 (see all)License:MIT
pypi i datastorm
Readme

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.

GitHub Stars

11

LAST COMMIT

3yrs ago

MAINTAINERS

1

CONTRIBUTORS

3

OPEN ISSUES

4

OPEN PRs

0
VersionTagPublished
0.0.0a8
3yrs ago
0.0.0a7
3yrs ago
0.0.0a6
3yrs ago
0.0.0a5
3yrs ago
No alternatives found
No tutorials found
Add a tutorial