Goblin
¶
Goblin - Python Object Graph Mapper for the TinkerPop3 Gremlin Server
As Gremlin approached The TinkerPop, mogwai
felt left behind and the closer
he got, the more his world dissolved. He realized that all that he realized was
just a realization and that all realized realizations are just as real as the
need to evolve into something else - goblin
was born...
Releases¶
The latest release of Goblin
is 0.2.1 (coming soon).
Requirements¶
Goblin
uses gremlinclient
to communicate with the
Gremlin Server, and can use a variety of client/library combinations
that work with different versions of Python. See the gremlinclient
docs for more information.
- Python 2.7+
- Python 3.4+
- Python 3.3+
- Python 2.7
Goblin
aims to provide full support for all TinkerPop3 enabled
graph databases; however, it is currently only tested against Titan:db 1.x.
This project is under active development, and early releases should be considered
alpha as the API is not yet entirely stable.
Getting Started¶
A simple example using the default Tornado client with Python 2.7+:
from tornado import gen
from tornado.ioloop import IOLoop
from goblin import properties
from goblin import connection
from goblin.models import Vertex, Edge, V
class User(Vertex):
name = properties.String()
class Follows(Edge):
pass
@gen.coroutine
def go():
goblin = yield User.create(name="Goblin")
gremlin = yield User.create(name="Gremlin")
gob_follows_grem = yield Follows.create(goblin, gremlin)
# Find Gremlin's followers
stream = yield V(gremlin).in_step().get() # `in` is a reserved word
followers = yield stream.read()
return followers
connection.setup("ws://localhost:8182")
loop = IOLoop.current()
try:
followers = loop.run_sync(go)
finally:
loop.close()
connection.tear_down()
Contributing¶
Goblin
is under active development on Github, and contributions are welcome.
More guidelines coming soon....
Contents: