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
Release history Release notifications | RSS feed
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)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cd362077bf064bad6301bc7fd423f2de6b2c5351dc42b4ad58fab4edf1daff1 |
|
MD5 | 060a2e0fdfe420ea02716639c098824b |
|
BLAKE2b-256 | 706fd39310b845265ff00af40b37adab0e820eb62da6bda8ba48707348265b67 |
File details
Details for the file luigi_neo4j_target-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: luigi_neo4j_target-1.0.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b46b74dff9571c8fe6e652760050a79e6b4ff051c85ea89604544bcb65d01f07 |
|
MD5 | 7f368f6138527f7fc7443da2c164221f |
|
BLAKE2b-256 | 6c5f2a22def6dd20f31a9fe9fd50d912ef2b9503e878f5cb04ebcb1179152dbe |