Skip to main content

embedded graph datastore

Project description

Graphlite

Graphlite is a tiny graph datastore that stores adjacency lists similar to FlockDB but like conventional graph databases, allow you to query them with traversals (graph-walking queries), and works with datasets that you can fit into your SQLite database.

from graphlite import connect, V
graph = connect(':memory:', graphs=['knows'])

with graph.transaction() as tr:
    for i in range(2, 5):
        tr.store(V(1).knows(i))
    tr.store(V(2).knows(3))
    tr.store(V(3).knows(5))

# who are the friends of the mutual friends
# of both 1 and 2?
graph.find(V(1).knows)\
     .intersection(V(2).knows)\
     .traverse(V().knows)

Graphlite is thread safe, meaning that when transactions are comitted (at the end of the with block), a lock is held and only the thread that commits gets to run. Thread safety is emphasised if you look at the test suite.

Installing

$ pip install graphlite

Contributing

If you want to contribute, we follow the Github workflow, so fork the repo, work on the code and just make a pull request (make sure all tests pass beforehand, at least in the last commit of your pull request). In short:

$ git clone ssh://git@github.com/$USERNAME/graphlite.git
$ cd graphlite
$ git checkout -b $FEATURE
$ # hackedy hack hack
$ py.test tests
$ git commit -a
$ git push

Note that we use py.test for testing so if you haven’t, make sure you pip install pytest. But you should.

  • Code status: Build
  • Maintainer: Eugene Eeo
  • License: MIT

Project details


Release history Release notifications

History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

This version
History Node

1.0.1

History Node

1.0.0

History Node

1.0.0-alpha

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
graphlite-1.0.1.tar.gz (6.8 kB) Copy SHA256 hash SHA256 Source None Aug 20, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page