Skip to main content

GraphIO

Tests PyPI License Neo4j Python Downloads

OGM and data loader for Neo4j with two main approaches:

  • OGM (Object Graph Mapper): Pydantic-based models with Neo4j integration for complex data models and applications
  • Datasets (NodeSet/RelationshipSet): Bulk data containers optimized for fast data loading and testing
  • Multi-Database Support: Full support for Neo4j Enterprise Edition multi-database feature

Documentation

Docs available at: https://graphio.readthedocs.io

Quick Start

Installation

Install graphio from PyPI:

pip install graphio

Install the latest version from GitHub:

pip install git+https://github.com/kaiserpreusse/graphio.git

Example

from graphio import NodeModel, Base
from neo4j import GraphDatabase

# Set up connection
driver = GraphDatabase.driver('neo4j://localhost:7687', auth=('neo4j', 'password'))
Base.set_driver(driver)
# Optional: Set target database (Enterprise Edition)
# Base.set_database('production')

# Define OGM model for structure and validation
class Person(NodeModel):
    _labels = ['Person']
    _merge_keys = ['email']
    name: str
    email: str

# Get bulk container directly from OGM model
people = Person.dataset()  # Automatically uses Person's labels and merge_keys

for person_data in large_dataset:
    # Create validated OGM instance and add directly
    person = Person(**person_data)  # Pydantic validation happens here
    people.add(person)  # Add validated instance to bulk dataset

people.create(driver)  # Bulk create with validation benefits

# Use OGM for application logic
alice = Person.match(Person.email == 'alice@example.com').first()

Development

Prerequisites

  • Python 3.10+
  • uv (recommended) or pip
  • Docker for running test databases

Setup

# Clone the repository
git clone https://github.com/kaiserpreusse/graphio.git
cd graphio

# Install dependencies
uv sync --extra dev

# Start Neo4j test databases
make localdb

Common Commands

# Run tests
make test

# Check code style  
make lint

# Format code
make format

# Fix linting issues and format
make fix

# Run all checks (lint + test)
make check

# Serve documentation locally
make docs

# See all available commands
make help

Testing

The test suite requires Docker containers running Neo4j. Start them with:

make localdb

Then run tests with:

make test
# or directly:
uv run pytest

All tests using the graph fixture will run against both Neo4j Community and Enterprise editions.

Feedback

Please provide feedback, ideas and bug reports through GitHub issues.

Download files

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

Source Distribution

graphio-0.22.tar.gz (97.5 kB view details)

Uploaded Source

Built Distribution

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

graphio-0.22-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file graphio-0.22.tar.gz.

File metadata

  • Download URL: graphio-0.22.tar.gz
  • Upload date:
  • Size: 97.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for graphio-0.22.tar.gz
Algorithm Hash digest
SHA256 6ed578ddfa4daaed368bf7c54a099ae2df2962fb0a3639251248d2f04f1a9bdf
MD5 ea0a79bbcc809d4440a9e01225513aca
BLAKE2b-256 bf7eea9127fa66a25348522b8d744dce62d455959596fe8dab5c86cf048c674c

See more details on using hashes here.

File details

Details for the file graphio-0.22-py3-none-any.whl.

File metadata

  • Download URL: graphio-0.22-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for graphio-0.22-py3-none-any.whl
Algorithm Hash digest
SHA256 524e4606f1ef40575a53a8f7bc4d5e86bfc8ce20db64c95c37ebb06280c21f1e
MD5 7d014c128bef463e253472bbb679b348
BLAKE2b-256 c1ce6cec8bebe25ffbc576e3ac648531c6a7f96e65d30399ad5440cf145bd93b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.22 This release

2 files

0.21

2 files

0.20

2 files

0.19

2 files

0.18

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.1

2 files

0.10.0

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.7

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

0.0.16

1 file

0.0.15

1 file

0.0.14

1 file

0.0.12

1 file

0.0.11

1 file

0.0.10

1 file

0.0.9

1 file

0.0.8

1 file

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

Supported by

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