DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Running Community Detection With Memgraph and Python NetworkX
  • Working With Neo4j Graph Database
  • Eclipse JNoSQL: A Quick Overview of Redis, Cassandra, Couchbase, and Neo4j
  • How Graph Databases Fight Organized Crime

Trending

  • Unleashing the Power of Microservices With Spring Cloud
  • A Better Web3 Experience: Account Abstraction From Flow (Part 2)
  • API Design
  • Mastering Persistence: Why the Persistence Layer Is Crucial for Modern Java Applications
  1. DZone
  2. Data Engineering
  3. Databases
  4. Embedded Neo4j Graph Database Now Works in Python

Embedded Neo4j Graph Database Now Works in Python

Jacob Hansson user avatar by
Jacob Hansson
·
Nov. 17, 11 · Interview
Like (0)
Save
Tweet
Share
10.45K Views

Join the DZone community and get the full member experience.

Join For Free
First of all, we’re really sorry. We have been saying that Python support for the embedded database is coming in “a few weeks” or “next month" for over half a year now, and so far, you have waited patiently, and you have waited in vain.


We promise to not give promises we can’t keep again, and we hope ya’ll know that we love Python just as much as the next guy.


Now, finally, the absolutely latest and greatest version of the embedded Neo4j database works in Python, and we’ve put a bunch of effort into ensuring it stays that way. The new bindings are constantly tested against each new build of the database, and are set up to deploy to PyPy as often as we all like them to.


The API is very similar to the original neo4j.py API. We also borrowed some of the API methods introduced in neo4j-rest-client, to make switching between the two as easy as possible.


This is a first release, so there may still be bugs lurking - please make sure to report any that you encounter and ideas for improvements to the project issue tracker!


Quick look

 
Here is a quick look at how you use neo4j-embedded.

from neo4j import GraphDatabase

db = GraphDatabase(‘/my/db/location’)

with db.transaction:
    oscar = db.node(name=’Oscar Wilde’)
    jacob = db.node(name=’Jacob’)

    # Create a relationship
    oscar.impressed_by_blogging_skills_of(jacob)
db.shutdown()
 

Requirements


The new bindings are tested on CPython 2.7.2 on Windows and Linux, but should work on Python 2.6 branches as well. 


You’ll need JPype installed to bridge the gap to Java land, details about how to set that up can be found in the installation instructions.


Jython support is on the todo list, but because Neo4j uses Java’s ServiceLoader API (which does not currently work in Jython) it will have to wait until we find a good workaround.


Getting started


Full instructions for how to install and get started can be found in the Neo4j Manual. For feedback, hints and contributions, don’t hesitate to ask on the Neo4j Forums.


Happy Hacking!
Python (language) Neo4j Database Graph (Unix)

Opinions expressed by DZone contributors are their own.

Related

  • Running Community Detection With Memgraph and Python NetworkX
  • Working With Neo4j Graph Database
  • Eclipse JNoSQL: A Quick Overview of Redis, Cassandra, Couchbase, and Neo4j
  • How Graph Databases Fight Organized Crime

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: