Ai
3 Star 12 Fork 6

Jimmy/VipQA

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
neo4j_provider.py 645 Bytes
一键复制 编辑 原始数据 按行查看 历史
Jimmy 提交于 2023-09-06 17:42 +08:00 . 添加框架结构代码
#!/usr/bin/python3
import os
from neo4j import GraphDatabase, basic_auth
from settings import settings
# Neo4j 数据库操作类
class Neo4jProvider:
"""创建 Neo4j 数据库连接"""
def __init__(self) -> None:
# 获取环境变量值,如果没有就返回默认值
url = settings.NEO4J_URI
username = settings.NEO4J_USER
password = settings.NEO4J_PASSWORD
neo4j_version = settings.NEO4J_VERSION
database = settings.NEO4J_DATABASE
port = int(settings.NEO4J_PORT)
self.driver = GraphDatabase.driver(url, auth=basic_auth(username, password))
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/VipSoft/VipQA.git
git@gitee.com:VipSoft/VipQA.git
VipSoft
VipQA
VipQA
FastAPI

搜索帮助