Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/versae/ipython-cypher
Jupyter Notebook (IPython) Neo4j Cypher cell magic
https://github.com/versae/ipython-cypher
Last synced: 1 day ago
JSON representation
Jupyter Notebook (IPython) Neo4j Cypher cell magic
- Host: GitHub
- URL: https://github.com/versae/ipython-cypher
- Owner: versae
- License: gpl-2.0
- Created: 2014-10-27T00:30:29.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-03-26T06:41:15.000Z (over 6 years ago)
- Last Synced: 2024-10-31T15:47:23.890Z (8 days ago)
- Language: Python
- Homepage: http://ipython-cypher.readthedocs.org
- Size: 400 KB
- Stars: 49
- Watchers: 4
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - versae/ipython-cypher - Jupyter Notebook (IPython) Neo4j Cypher cell magic (others)
README
==============
ipython-cypher
==============:Author: Javier de la Rosa, http://versae.es
Introduces a ``%cypher`` (and ``%%cypher``) magic for Neo4j in IPython.
Inspired by Catherine Devlin's ipython-sql_.Connect to a graph database, using ``neo4jrestclient_`` driver, then issue Cypher
commands within IPython or IPython Notebook. See examples_.Install
-------
As easy as usual::pip install ipython-cypher
Usage
-----Inside IPython, load the extension::
%load_ext cypher
And then you are reay to go by using the ``%cypher`` line magic::
%cypher MATCH (a)-[]-(b) RETURN a, b
Some Cypher queries can be very long, in those cases the the cell magic,
``%%cypher`` comes in handy::%%cypher
create
// Nodes
(Neo:Crew {name:'Neo'}),
(Morpheus:Crew {name: 'Morpheus'}),
(Trinity:Crew {name: 'Trinity'}),
// Relationships
(Neo)-[:KNOWS]->(Morpheus),
(Neo)-[:LOVES]->(Trinity),Note that by default ``ipython-cypher`` will connect to ``http://localhost:7474/db/data``.
Queries results can be stored in a variable and then converted to a Pandas
``DataFrame``::results = %cypher MATCH (a)-[]-(b) RETURN a, b
results.get_dataframe()Or to a NetworkX ``MultiDiGraph``::
results.get_graph()
For more detailed descriptions, please visit the official documentation_.
.. _examples: http://nbviewer.ipython.org/github/versae/ipython-cypher/blob/master/docs/examples.ipynb
.. _neo4jrestclient: https://pypi.python.org/pypi/neo4jrestclient
.. _documentation: http://ipython-cypher.readthedocs.org/en/latest/
.. _ipython-sql: https://github.com/catherinedevlin/ipython-sql