Giter Site home page Giter Site logo

euanong / cypher_kernel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from helgecph/cypher_kernel

0.0 0.0 0.0 6.57 MB

An experimental Jupyter kernel wrapping the Cypher query language and Neo4j via a REPLWrapper around cypher-shell.

Python 3.11% Jupyter Notebook 60.17% Shell 0.49% Batchfile 0.25% Makefile 0.03% HTML 35.95%

cypher_kernel's Introduction

Cypher Kernel

This is a small Jupyter kernel wrapping the Cypher language and Neo4j https://neo4j.com/developer/cypher/.

Why? Do I need a Cypher language kernel?

I started working on this kernel as I am teaching on Cypher and Neo4j as part of a database course on Copenhagen Business Academy.

Usually, my lecture notes are in Jupyter notebooks and I use the Jupter extension RISE to make slideshows with executable code.

In the classes on graph databases, I want to focus on the query language Cypher. That is, I do not want to have Cypher embedded in Python such as with icypher -a %cypher magic sending queries with the help of py2neo- or in plain Python notebooks

How does it look like?

In case you do not have a Python environment with Jupyter installed on your system, you can see in the following how the rendered notebooks -not the presentations- could look like, see:

Installation

To install the cypher_kernel from PyPi:

pip install cypher_kernel
python -m cypher_kernel.install

To work on this code directly, you may want to:

git clone [email protected]:HelgeCPH/cypher_kernel.git
cd cypher_kernel
pip install .
python -m cypher_kernel.install

Configuration

To configure a Neo4j user, password, and the address of the Neo4j REST API, you can specify the values in the configuration file cypher_config.yml. Normally, this file is located under ~/.jupyter/. In case the file is not existent the following default configuration is used:

user: 'neo4j'
pwd: 'neo4j'
host: 'localhost:7474'
connect_result_nodes: False
cmd_timeout: null

Using the Cypher Kernel

Notebook: The New menu in the notebook should show an option for an Cypher notebook.

Console frontends: To use it with the console frontends, add --kernel cypher to their command line arguments.

Neo4j for Presentations

To get quickly started -under the assumption you have Docker installed- start up a Neo4j DBMS instance with:

docker run --rm --publish=7474:7474 --publish=7687:7687 neo4j
docker run --rm --publish=7474:7474 --publish=7687:7687 --env=NEO4J_dbms_memory_pagecache_size=4G neo4j
  • Navigate with your browser to http://localhost:7474
  • Login with neo4j as username and password respectively
  • Change the password to a new one. OBS Do not forget to add this password to the cypher_config.yml, see above.
  • Now, create a new Cypher notebook.

See more on configuring the Neo4j container https://neo4j.com/docs/operations-manual/current/installation/docker/

What? I have Docker but no pip and other Python stuff?!

Likely the easiest way to get started, have:

pip install cypher_kernel
python -m cypher_kernel.install
  • The Jupyter Notebook server up and running:
jupyter notebook

That should be it...

cypher_kernel's People

Contributors

sim51 avatar euanong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.