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-1.0.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

luigi_neo4j_target-1.0.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: luigi_neo4j_target-1.0.0.tar.gz
  • Upload date:
  • Size: 14.2 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-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6cd362077bf064bad6301bc7fd423f2de6b2c5351dc42b4ad58fab4edf1daff1
MD5 060a2e0fdfe420ea02716639c098824b
BLAKE2b-256 706fd39310b845265ff00af40b37adab0e820eb62da6bda8ba48707348265b67

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for luigi_neo4j_target-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b46b74dff9571c8fe6e652760050a79e6b4ff051c85ea89604544bcb65d01f07
MD5 7f368f6138527f7fc7443da2c164221f
BLAKE2b-256 6c5f2a22def6dd20f31a9fe9fd50d912ef2b9503e878f5cb04ebcb1179152dbe

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