Book Image

Building web applications with Python and Neo4j

By : Sumit Gupta
Book Image

Building web applications with Python and Neo4j

By: Sumit Gupta

Overview of this book

Table of Contents (14 chapters)
Building Web Applications with Python and Neo4j
About the Author
About the Reviewers

Exploring the py2neo APIs

Py2neo provides various features and exposes a number of APIs to work with Neo4j. Let's discuss a few of the important APIs that we will use along with the examples in the upcoming sections.


Graph is one of the basic APIs and contains all the basic operations related to the graph database. It is a wrapper around the REST API (, exposed by Neo4j. It connects to the base URI of Neo4j, and then further discovers other REST endpoints exposed by Neo4j. Graph can be used to connect to the local or remote Neo4j server. It can also connect the Neo4j server running behind the firewall by providing the username in the URL itself. The following are the code snippets for using the Graph API and connecting to the Neo4j server:

  • Connecting to the local Neo4j server:

    graph = Graph("http://localhost:7474/db/data/")
  • Connecting to the remote Neo4j server:

    graph = Graph("http://<Domain_Name>:<PORT>/db/data/")
  • Connecting...