Py's py2neo: Detailed guide to the introduction, installation and usage of py2neo
Table of contents
Introduction to py2neo
py2neo is a client library and toolkit for using Neo4j in Python applications. The library supports both Bolt and HTTP and provides a high-level API, OGM, management tools, Cypher lexer for py tweets, and many other additional features.
The command line tools have been removed from the library in py2neo 2021.2. This functionality now exists in a separate ipy2neo project. Starting with version 2021.1, py2neo includes full support for routing, which is exposed by Neo4j cluster. This can be done using the neo4j://… URI or by passing routing=True to the Graph constructor.
Installation of py2neo
conda install py2neo
How to use py2neo
1. Basic usage
from py2neo import Graph
graph = Graph("bolt://localhost:7687", auth=("neo4j", "password"))
graph.run("UNWIND range(1, 3) AS n RETURN n, n * n as n_sq")