Skip to main content

A Luigi Target implementation for Neo4j.

Project description

luigi-neo4j-target

A Luigi Target implementation for Neo4j

Installation

Install the package via pip:

pip install luigi-neo4j-target

Usage

Basic usage

from luigi_chromadb_target import ChromaTarget
import neo4j

uri = "bolt://localhost:7687"
driver = neo4j.GraphDatabase.driver(uri, auth=("neo4j", "neo4j"))
target = Neo4jTarget(driver, 'sample_graph')

alice = Node(label="Person", properties={"name": "Alice", "age": 30})
bob = Node(label="Person", properties={"name": "Bob", "age": 25})
friendship = Relationship(start_node=alice, end_node=bob, rel_type="FRIENDS_WITH")

graph = Graph()
graph.add_node(alice)
graph.add_node(bob)
graph.add_relationship(friendship)

target.put(graph)

g = target.get()
print(g)

Advanced options

def my_marshaler(g:str) -> Graph:
    # a logic to transform g string into a Graph
    return Graph

def my_unmarshaler(g:Graph) -> str:
    # a logic to transform Graph g into a string
    return '{my-string-graph-representation}'

target = Neo4jTarget(
    driver,
    'sample_graph',
    marshaler=my_marshaler,
    unmarshaler=my_unmarshaler)

target.put('{my-string-graph-representation}')

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

luigi_neo4j_target-0.1.1.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

luigi_neo4j_target-0.1.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file luigi_neo4j_target-0.1.1.tar.gz.

File metadata

  • Download URL: luigi_neo4j_target-0.1.1.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for luigi_neo4j_target-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f5e73c3afdc7cdeb5b7ac730ebf08572f4a5ce01c0737e3573b6823c1a2899b4
MD5 53ad301f1ef78a6e5c2821d6e0dd717f
BLAKE2b-256 e326f36a35d61b3343a68f926380905b282e0c704ea939dbaacd6780ac9289fd

See more details on using hashes here.

File details

Details for the file luigi_neo4j_target-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for luigi_neo4j_target-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16a0c5e1ec902295b9c53c6ce5a207e0f8f61ed0b206fe8853c884643ef62797
MD5 9afe1623816741955a0b94731e0be8f1
BLAKE2b-256 d7c0fe89a8425bbd2ee12fb53d3dfab23ad03d0bfb00e1a35c89a1213265eb13

See more details on using hashes here.

Supported by

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