Goals This guide provides an overview of how to connecting to Neo4j from Python. While it is not comprehensive, it aims to introduce the available drivers and links to other relevant resources. Prerequisites You should be familiar with graph database… Learn More →
This guide provides an overview of how to connecting to Neo4j from Python. While it is not comprehensive, it aims to introduce the available drivers and links to other relevant resources.
Neo4j can be installed on any system and then accessed via its binary and HTTP APIs.
You can use the official binary driver for Python (neo4j-python-driver) or connect via HTTP with any of our community drivers.
Neo4j Python Driver
The Neo4j Python driver is officially supported by Neo4j and connects to the database using the binary protocol. It aims to be minimal, while being idiomatic to Python.
The Neo4j Team, Nigel Small
The Example Project
The Neo4j example project is a small, one page webapp for the movies database built into the Neo4j tutorial. The front-end page is the same for all drivers: movie search, movie details, and a graph visualization of actors and movies. Each backend implementation shows you how to connect to Neo4j from each of the different languages and drivers.
Neo4j Community Drivers
|The drivers below have been thankfully contributed by the Neo4j community. Many of these are fully featured and well maintained. But we don’t take any responsibility for their fitness for use with the most recent versions of Neo4j.|
For anyone working with Python, the Neo4j community have contributed a range of driver options. These range from lightweight to comprehensive driver packages as well as libraries designed for use with web frameworks such as Django.
Both Python 2 and Python 3 are supported by most of the libraries listed here and this should help give more flexibility when putting together your Neo4j-based technology stack.
Many Pythonistas have invested a lot of time and love to develop these libraries, so if you use them, please provide feedback to the authors and help us improve.
Py2neo is a client library and comprehensive toolkit for working with Neo4j from within Python applications and from the command line. The core library has no external dependencies and has been carefully designed to be easy and intuitive to use.
2.7 / 3.3 / 3.4
The main goal of neo4j-rest-client was to enable Python programmers already using Neo4j locally through python-embedded, to use the Neo4j REST server. So the syntax of neo4j-rest-client’s API is fully compatible with python-embedded. However, a new syntax is introduced in order to reach a more pythonic style and to enrich the API with the new features the Neo4j team introduces.
Bulbs is an open-source Python persistence framework for graph databases and the first piece of a larger web development toolkit. It’s like an ORM for graphs.
2.6 / 2.7 / 3.0 / 3.1 / 3.2
An Object Graph Mapper (OGM) also usable for Django for the Neo4j graph database.
2.7 / 3.4 / pypy / pypy3
- Using Neo4j from Python
- Using Neo4j from Kivy
- A script to automatically migrate relational databases to Neo4J
- Py2neo Spatial
- Holger Spill: An introduction to Python and graph databases with Neo4j
- Python NLTK/Neo4j: Analysing the transcripts of How I Met Your Mother
- Flask and Neo4j
- Using Jupyter and Neo4j with Docker
- Neo4j Jupyter Visualization Notebook