skip to navigation
skip to content

Not Logged In

kenji 0.3.0

simple sqlite-backed graph datastore

Latest Version: 0.3.1

Relations, simplified- Kenji stores property-less relations between your data, in an SQLite3 backend, inspired by Twitter’s distributed FlockDB. Kenji is tiny, just like the apps it’s meant for. Just:

$ pip install kenji

Then initialize a graph, and then play around with it.

from kenji import Graph, V
g = Graph(graphs=['knows'])

g.store(V(2).knows(1))
for i in range(2, 5):
    g.store(V(1).knows(i))

assert g.exists(V(1).knows(2))
assert list(g.select(V(1).knows)) == [2,3,4]
assert g.select(V().knows(1)).first == 2

FAQ

1. Is Kenji thread-safe? Kenji is thread safe, as long as you use it with the constraints of the SQLite library. According to the SQLite docs, threads are evil.

2. What about transactions? Currently there is no guaranteed method of making atomic transactions thread-safe, primarily because they aren’t thread safe in the SQLite3 library as well. We can sacrifice atomicity for thread safety but then again, that means that you won’t really have a transaction.

3. Is Kenji a property graph? No, it is merely a social graph. If you need properties in edges between nodes then you should consider other graphs like Neo4j.

 
File Type Py Version Uploaded on Size
kenji-0.3.0.tar.gz (md5) Source 2014-08-01 7KB
  • Downloads (All Versions):
  • 12 downloads in the last day
  • 74 downloads in the last week
  • 230 downloads in the last month