Skip to content
Simple IPython magic for running cypher commands
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cypher_magic
.gitignore
LICENSE
README.md
setup.py

README.md

cypher magic

Really simple IPython magic for running cypher commands.

At the moment the ability to connect to arbitrary neo4j databases is limited - the only configurable connection parameter currently available is the password.

For a demo, see: psychemedia/binder-neo4j.

Install via:

  • pip install .
  • pip install --upgrade git+https://github.com/innovationOUtside/cypher_magic.git

This magic was developed to work by default inside a MyBinder container containing a Neo4j server running on default ports with user neo4j and password neo4jbinder.

Load the magic with:

%load_ext cypher_magic

The magic allows you to run Cypher commands against the connected database using default credentials (the default password is set to neo4jbinder). You can change the password with the -p/--password variable; the -q flag suppresses the cell output.

%cypher -r
%cypher -q -p neo4jbinder

Call as line magic %cypher or block magic: %%cypher

The line magic is perhaps most useful when called with a query passed via a variable. For example:

q='MATCH (p:Person) RETURN p.name AS name'
%cypher -v q

the magic will return a pandas dataframe by default. Other return formats, set using the -o/--output parameter, include table and matrix (the latter requires sympy to be installed).

You can’t perform that action at this time.