ipython-gremlin¶
ipython-gremlin is an IPython extension module that allows the user to magically submit scripts to the TinkerPop Gremlin Server using %gremlin (line) and %%gremlin (cell) magic...
ipython-gremlin also provides basic integration with pandas and NetworkX data/graph analysis libraries to translate Gremlin traversal results to the data structures commonly used in Python scientific computing.
This work is based on Javier de la Rosa’s excellent ipython-cypher extension.
Check out this example IPython notebook
Releases¶
The latest release of ipython-gremlin
is 1.0.0.
Requirements¶
- Python 3.5 +
- TinkerPop 3.2.4
Dependencies¶
- aiogremlin 3.2.4
- ipython 5.3.0
To leverage the full power of ipython-gremlin
, please install commonly used
scientific computing libraries:
$ pip install pandas
$ pip install networkx
$ pip install matplotlib
Getting Started¶
Load the extension:
%load_ext gremlin
Submit a script to the Gremlin Server:
%gremlin g.V()
Store query results in a variable:
verts = %grelmin g.V()
Get a pandas pandas.DataFrame
:
verts = %gremlin g.V()
df = verts.get_dataframe()
Get a NetworkX networkx.MultiDiGraph
from a collection of elements:
edges = %gremlin g.E()
graph = edges.get_graph()
Contribute¶
Contributions are welcome. If you find a bug, or have a suggestion, please open an issue on Github. If you would like to make a pull request, please make sure to add appropriate tests and run them:
$ ipython setup.py test
I am particularly interested in adding features that integrate Pandas and NetworkX. ipython-cypher has some good examples of this.
Contents: