Skip to main content

SQL Alchemy dialect for Neo4j

Project description

SQL Alchemy dialect for Neo4j

This package provides the SQL dialect for Neo4j, using the official JDBC driver (the Neo4j "BI Connector" )

Installation

pip install sqlalchemy-neo4j

Prerequisites

  • 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 JVM

    You 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 )

Getting started

from sqlalchemy import create_engine
from 

# 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

Related projects

  • Neo4j Metabase Driver - Use Neo4j with Metabase. Use both SQL and Cypher ( the driver uses the same underlying BI connector for SQL queries )

Future

  • Add Cypher support
  • Add support for Cypher views in JDBC driver
  • Add ORM support and testing

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sqlalchemy-neo4j-0.2.dev0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqlalchemy_neo4j-0.2.dev0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file sqlalchemy-neo4j-0.2.dev0.tar.gz.

File metadata

  • Download URL: sqlalchemy-neo4j-0.2.dev0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.9 Darwin/21.4.0

File hashes

Hashes for sqlalchemy-neo4j-0.2.dev0.tar.gz
Algorithm Hash digest
SHA256 29eec60fad66992dbdae2c4ebd8b602647d2c14b0cbecc7c640a44d4f2116018
MD5 d370e619325cf6cb5f56be431b5c9d58
BLAKE2b-256 bbe90b570b9f320037f407efe0713a2d00a02f922c0b48284f1b04d9f49e8ab3

See more details on using hashes here.

File details

Details for the file sqlalchemy_neo4j-0.2.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for sqlalchemy_neo4j-0.2.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2b6f997a1a3b5778a39d9921708c008db13b8d8f5ed8ddbf1e07c0bf1f606ca
MD5 e41371ad9e9262ff14ca63b85e6beaea
BLAKE2b-256 5395528e3fbc4f081e126a3c1a517e00d8b369c1c382fad7f9346e75fe611b00

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page