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.

The library is currently under construction and API changes are unevitable until it’s released on PyPI. Currently I’m working on stabilising the API so we can hit 1.0 as soon as possible.

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
$ 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


Download files

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

Source Distribution

graphlite-1.0.0.tar.gz (7.3 kB view details)

Uploaded Source

File details

Details for the file graphlite-1.0.0.tar.gz.

File metadata

  • Download URL: graphlite-1.0.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for graphlite-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b3add083253be8805017d68e70a9b97edd45115541310ab4de5cec680fae0082
MD5 50a94bc6c7d5f680c420511aa56bd425
BLAKE2b-256 ed4847f69c2495d83cdde8b893e52052acab4f9b0d49bf87cbab545701b60148

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page