SQL Alchemy dialect for Neo4j

Overview

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
You might also like...
TunBERT is the first release of a pre-trained BERT model for the Tunisian dialect using a Tunisian Common-Crawl-based dataset.
TunBERT is the first release of a pre-trained BERT model for the Tunisian dialect using a Tunisian Common-Crawl-based dataset.

TunBERT is the first release of a pre-trained BERT model for the Tunisian dialect using a Tunisian Common-Crawl-based dataset. TunBERT was applied to three NLP downstream tasks: Sentiment Analysis (SA), Tunisian Dialect Identification (TDI) and Reading Comprehension Question-Answering (RCQA)

DziriBERT: a Pre-trained Language Model for the Algerian Dialect
DziriBERT: a Pre-trained Language Model for the Algerian Dialect

DziriBERT is the first Transformer-based Language Model that has been pre-trained specifically for the Algerian Dialect.

Lightweight Markdown dialect for Python desktop apps
Lightweight Markdown dialect for Python desktop apps

Litemark is a lightweight Markdown dialect originally created to be the markup language for the Codegame Platform project. When you run litemark from the command line interface without any arguments, the Litemark Viewer opens and displays the rendered demo.

DziriBERT: a Pre-trained Language Model for the Algerian Dialect
DziriBERT: a Pre-trained Language Model for the Algerian Dialect

DziriBERT DziriBERT is the first Transformer-based Language Model that has been pre-trained specifically for the Algerian Dialect. It handles Algerian

A Sublime Text plugin to select a default syntax dialect

Default Syntax Chooser This Sublime Text 4 plugin provides the set_default_syntax_dialect command. This command manipulates a syntax file (e.g.: SQL.s

Sqlalchemy-databricks - SQLAlchemy dialect for Databricks

sqlalchemy-databricks A SQLAlchemy Dialect for Databricks using the officially s

Py2neo is a comprehensive toolkit for working with Neo4j from within Python applications or from the command line.

Py2neo Py2neo is a client library and toolkit for working with Neo4j from within Python applications and from the command line. The library supports b

Neo4j Bolt driver for Python

Neo4j Bolt Driver for Python This repository contains the official Neo4j driver for Python. Each driver release (from 4.0 upwards) is built specifical

Simple script to extract useful informations from the combo BloodHound + Neo4j

bloodhound-quickwin Simple script to extract useful informations from the combo BloodHound + Neo4j. Can help to choose a target. Prerequisites python3

Create a Neo4J graph of users and roles trust policies within an AWS Organization.
Create a Neo4J graph of users and roles trust policies within an AWS Organization.

AWS_ORG_MAPPER This tool uses sso-oidc to authenticate to the AWS organization. Once authenticated the tool will attempt to enumerate all users and ro

BloodCheck enables Red and Blue Teams to manage multiple Neo4j databases and run Cypher queries against a BloodHound dataset.

BloodCheck BloodCheck enables Red and Blue Teams to manage multiple Neo4j databases and run Cypher queries against a BloodHound dataset. Installation

Import, visualize, and analyze SpiderFoot OSINT data in Neo4j, a graph database
Import, visualize, and analyze SpiderFoot OSINT data in Neo4j, a graph database

SpiderFoot Neo4j Tools Import, visualize, and analyze SpiderFoot OSINT data in Neo4j, a graph database Step 1: Installation NOTE: This installs the sf

Open Source Tool - Cybersecurity Graph Database in Neo4j

GraphKer Open Source Tool - Cybersecurity Graph Database in Neo4j |G|r|a|p|h|K|e|r| { open source tool for a cybersecurity graph database in neo4j } W

Networkx with neo4j back-end

Dump networkx graph into nodes/relations TSV from neo4jnx.tsv import graph_to_tsv g = pklload('indranet_dir_graph.pkl') graph_to_tsv(g, 'docker/nodes.

Py2neo is a client library and toolkit for working with Neo4j from within Python

Py2neo Py2neo is a client library and toolkit for working with Neo4j from within Python applications. The library supports both Bolt and HTTP and prov

A Python wrapper API for operating and working with the Neo4j Graph Data Science (GDS) library

gdsclient NOTE: This is a work in progress and many GDS features are known to be missing or not working properly. This repo hosts the sources for gdsc

Uses Sharphound, Bloodhound and Neo4j to produce an actionable list of attack paths for targeted remediation.
Uses Sharphound, Bloodhound and Neo4j to produce an actionable list of attack paths for targeted remediation.

GoodHound ______ ____ __ __ / ____/___ ____ ____/ / / / /___ __ ______ ____/ / / / __/ __ \/ __ \/ __

Easy-to-use data handling for SQL data stores with support for implicit table creation, bulk loading, and transactions.

dataset: databases for lazy people In short, dataset makes reading and writing data in databases as simple as reading and writing JSON files. Read the

A non-validating SQL parser module for Python

python-sqlparse - Parse SQL statements sqlparse is a non-validating SQL parser for Python. It provides support for parsing, splitting and formatting S

Comments
  • error message in the logs

    error message in the logs

    FYI, when I use your example, I got some error message in the logs

    To remove it I found 2 solutions

        jpype.startJVM()
    
        import jpype.imports
        from java.lang import System
     System.setProperty("log4j2.loggerContextFactory","com.simba.neo4j.shaded.apache.logging.log4j.simple.SimpleLoggerContextFactory")
    

    and to remove the info logs

        jpype.startJVM()
    
        import jpype.imports
        from java.lang import System
        System.setProperty("log4j2.loggerContextFactory","com.simba.neo4j.shaded.apache.logging.log4j.simple.SimpleLoggerContextFactory")
    
        from java.util.logging import LogManager
        LogManager.getLogManager().reset()
    
    opened by nicolas-cyfix 3
  • installation issue

    installation issue

    Hi,

    I really would like to try your driver. but when I install it

    • on a Debian 11
    • Java 11 is install (default-are)

    I got this error:

    pip install sqlalchemy-neo4j
    Collecting sqlalchemy-neo4j
      Downloading sqlalchemy_neo4j-0.1.dev0-py3-none-any.whl (18 kB)
    Collecting jaydebeapi
      Downloading JayDeBeApi-1.2.3-py3-none-any.whl (26 kB)
    Collecting jpype
      Downloading jpype-0.0.tar.gz (541 bytes)
        ERROR: Command errored out with exit status 1:
         command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-pk1meydh/jpype_1c8c781209824a1d83b7166a9cb83e90/setup.py'"'"'; __file__='"'"'/tmp/pip-install-pk1meydh/jpype_1c8c781209824a1d83b7166a9cb83e90/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-_63dpvjh
             cwd: /tmp/pip-install-pk1meydh/jpype_1c8c781209824a1d83b7166a9cb83e90/
        Complete output (8 lines):
        
        =========================================
        
        Please install the `JPype` with ``pip install jpype1``
        
        =========================================
        
        
        ----------------------------------------
    WARNING: Discarding https://files.pythonhosted.org/packages/92/86/80f8af65d7a681c970914c4ed1cb98178bbd1f1ac7fdff0a2bab75c47708/jpype-0.0.tar.gz#sha256=db973cd5fc031b37bb8968139d4333836d9fb402ce660be9ce52d9f8d1c1cbdf (from https://pypi.org/simple/jpype/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    ERROR: Could not find a version that satisfies the requirement jpype (from sqlalchemy-neo4j) (from versions: 0.0)
    ERROR: No matching distribution found for jpype
    

    Do you know what I am missing?

    opened by nicolas-cyfix 2
Owner
Beni Ben zikry
Beni Ben zikry
Neo4j Movies Example application with Flask backend using the neo4j-python-driver

Neo4j Movies Application: Quick Start This example application demonstrates how easy it is to get started with Neo4j in Python. It is a very simple we

Neo4j Examples 309 Dec 24, 2022
A Flask web application that manages student entries in a SQL database

Student Database App This is a Flask web application that manages student entries in a SQL database. Users can upload a CSV into the SQL database, mak

rebecca 1 Oct 20, 2021
RestApi_flask_sql.alchemy - Product REST API With Flask & SQL Alchemy

REST API With Flask & SQL Alchemy Products API using Python Flask, SQL Alchemy and Marshmallow Quick Start Using Pipenv # Activate venv $ pipenv shell

amirwahla 1 Jan 1, 2022
Neo4j Movies Example application with Flask backend using the neo4j-python-driver

Neo4j Movies Application: Quick Start This example application demonstrates how easy it is to get started with Neo4j in Python. It is a very simple we

Neo4j Examples 309 Dec 24, 2022
PyPika is a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting query. PyPika excels at all sorts of SQL queries but is especially useful for data analysis.

PyPika - Python Query Builder Abstract What is PyPika? PyPika is a Python API for building SQL queries. The motivation behind PyPika is to provide a s

KAYAK 1.9k Jan 4, 2023
DeepMind Alchemy task environment: a meta-reinforcement learning benchmark

The DeepMind Alchemy environment is a meta-reinforcement learning benchmark that presents tasks sampled from a task distribution with deep underlying structure.

DeepMind 188 Dec 25, 2022
Soda SQL Data testing, monitoring and profiling for SQL accessible data.

Soda SQL Data testing, monitoring and profiling for SQL accessible data. What does Soda SQL do? Soda SQL allows you to Stop your pipeline when bad dat

Soda Data Monitoring 51 Jan 1, 2023
tfquery: Run SQL queries on your Terraform infrastructure. Query resources and analyze its configuration using a SQL-powered framework.

??️ tfquery ??️ Run SQL queries on your Terraform infrastructure. Ask questions that are hard to answer ?? What is tfquery? tfquery is a framework tha

Mazin Ahmed 311 Dec 21, 2022
dask-sql is a distributed SQL query engine in python using Dask

dask-sql is a distributed SQL query engine in Python. It allows you to query and transform your data using a mixture of common SQL operations and Python code and also scale up the calculation easily if you need it.

Nils Braun 271 Dec 30, 2022
Given a metadata file with relevant schema, an SQL Engine can be run for a subset of SQL queries.

Mini-SQL-Engine Given a metadata file with relevant schema, an SQL Engine can be run for a subset of SQL queries. The query engine supports Project, A

Prashant Raj 1 Dec 3, 2021