This package provides the SQL dialect for Neo4j, using the official JDBC driver (the Neo4j "BI Connector" )
pip install sqlalchemy-neo4j
- Java 8 / 11
- Download the Neo4j BI Connector
The reason the JAR is not included in the package is due to licensing concerns. I may add the jar into the bundle in the future.
- Add the jar to the classpath, either directly via the
CLASSPATH
environment variable or while initializing the JVMYou can also use the
NEOJDBC_WARMUP
environment variable, which will ensure we reuse an existing jpype instance or create a new one ( with default parameters )
from sqlalchemy import create_engine
# This happens automatically if you set the NEOJDBC_WARMUP environment variable
jpype.startJVM()
eng = create_engine("neo4j+jdbc://neo4j-neo4j:7687/neo4j?UID=neo4j&PWD=QUOTED_PASSWORD&LogLevel=6&StrictlyUseBoltScheme=false")
execute = engine.execute("select * from Node.YOUR_NODE limit 1")
rows = execute.fetchall()
for row in rows:
print(row)
See more examples
- Neo4j Metabase Driver - Use Neo4j with Metabase. Use both SQL and Cypher ( the driver uses the same underlying BI connector for SQL queries )
- Add Cypher support
- Add support for Cypher views in JDBC driver
- Add ORM support and testing
Did this project help you out?
bbenzikry.eth / 0x10c97e3e727cb3ee0bafb4f99f63225525150a35