python 操作 neo4j
将neo4j连接封装成类
!pip install neo4j -i https://pypi.tuna.tsinghua.edu.cn/simple
from neo4j import GraphDatabase
class Neo4jConnection:
def __init__(self, uri, user, pwd):
self.__uri = uri
self.__user = user
self.__pwd = pwd
self.__driver = None
try:
self.__driver = GraphDatabase.driver(self.__uri, auth=(self.__user, self.__pwd))
共有 0 条评论