Giter Club home page Giter Club logo

gludb's Introduction

GLUDB

Travis CI Build State Travis CI Details

Documentation State See our documentation at http://gludb.readthedocs.io/

Generalized Learning Utilities Database Library

For more GLU, see also SuperGLU

GLUDB provides a simple way to read/write data to some popular datastores like Amazon's DynamoDB and Google Cloud Datastore. We provide:

  • A simple abstraction layer for annotating classes that need serialization
  • Support for versioning by automatically storing change history with the data
  • Automated "indexing", which includes querying on the value of indexes
  • Automated, configurable backup to Amazon's S3 (and Glacier depending on how you configure the S3 buckets)

We support Python 2 (2.7 and greater) and 3 (3.4 and greater). The data stores supported are:

  • sqlite
  • DynamoDB
  • Google Cloud Datastore
  • MongoDB
  • PostgreSQL (version 9.5 and greater)

Installing

You can install from PyPI using pip:

pip install gludb

You will also need to install any dependencies you need based on the functionality you want to use:

  • DynamoDB Backend - boto
  • Google Cloud Datastore - googledatastore
  • MongoDB - pymongo
  • Backups - boto

setup.py includes these dependencies so that you can install them all at the same time (assuming a decently recent version of pip). As an example, you could install gludb and the dependencies needed for DynamoDB and backup support into a virtualenv using Python 3 like this:

user@host:~$ virtualenv -p python3 env
user@host:~$ . env/bin/activate
user@host:~$ pip install --upgrade pip wheel
user@host:~$ pip install gludb[dynamodb,backups]

gludb's People

Contributors

benjamid avatar craigkelly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gludb's Issues

Rebuild Table

New functionality - we should be able to change a table's name, recreate the table, and then do a full read/write.

Notes:

  • We'll need a different algorithm for Dynamo
  • We probably won't support GCD at first

Simple.DBObject clobbers user-defined __init__

In DBObject, we take control of init and give the user the setup method.

That's because Python method dispatch is MRO, named-based, and handled at runtime. That's all great, but if the original init that we replace manually called the superclass init, then our replacement init gets called. And that happens regardless of whether or not you use the super keyword. Another issue is the possibility of infinite recursion if you're not careful.

In fact, constructor call order with an arbitrary inheritance hierarchy is pretty difficult to support when your providing the kind of extra functionality we're talking about. That's why the design is switched - our special constructor is called once for the entire hierarchy and uses Python's MRO on class variables to determine what Fields it needs.

However, clobbering a user-supplied init is pretty much always a bad idea, so we should throw an exception. Something like:

prev_init = getattr(cls, "__init__", None)
if callable(prev_init) and prev_init != object.__init__:
    raise TypeError('Classes with user-supplied __init__ should not be decorated with DBObject. Use the setup method')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.