No project description provided
Project description
Neo4j-uploader
For uploading specially formatted dictionary data to a specific Neo4j database instance
Dictionary Format
Either a .json or dictionary can be passed as an arg into the upload() function.
This dictionary must have a key named nodes
and optionally one named relationships
The value for the nodes
key must be a dictionary, where each key is the primary node label for the node records to upload. The value of each is a list of dictionaries that represent node properties to upload.
The value for the relationships
key must be a dictionary, where each key is relationship type. The value of each is a list of dictionaries that are the relationship properties to upload.
Every record dictionary must have _uid
key and the relationships must have a _from__uid
and _to__uid
key.
Example .json:
{
"nodes": {
"Person": [
{
"first_name": "Jaclyn",
"last_name": "Stacey",
"email": "{'reference': ['first_name']}.{'reference': ['last_name']}@email.com",
"_uid": "b267e10d-998b-4804-b5a5-fe84b9ee982a"
},
{
"first_name": "Ryan",
"last_name": "Adam",
"email": "{'reference': ['first_name']}.{'reference': ['last_name']}@email.com",
"_uid": "0053fd25-71e4-40c1-80ff-f6b7e4211c77"
}
]
},
"relationships": {
"LIVES_WITH": [
{
"_from__uid": "b267e10d-998b-4804-b5a5-fe84b9ee982a",
"_to__uid": "0053fd25-71e4-40c1-80ff-f6b7e4211c77",
"_uid": "9db12425-0eba-47cf-8654-84ad235f98c1"
}
]
}
}
Usage
pip install neo4j-uploader
In your application
from neo4j_uploader import upload
credentials = ("database_uri", "user", "password")
data = ...<dictionary_or_json_payload>
upload(credentials, data)
Limitations
This package currently requires the .json data payload to be strictly formatted to the above requirements.
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
Built Distribution
File details
Details for the file neo4j_uploader-0.1.0.tar.gz
.
File metadata
- Download URL: neo4j_uploader-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.3 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6c752c71bd487110a81e1650c16a520ca59ed0f16d6cf8e688064b715358168 |
|
MD5 | c272c44ee250015ef21cc01840a3c20a |
|
BLAKE2b-256 | 75b38e5ec7947cd87aa2341e83d6dfd8e3ff48821aa46acd88cb6d92723e0596 |
File details
Details for the file neo4j_uploader-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: neo4j_uploader-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.3 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12827f6766e9916b6a8f3c78d6de8e4bf1ac622081bfc1bf4c53f1525efd3a46 |
|
MD5 | f137d6f4559a8a766a8ba107a73dbc9d |
|
BLAKE2b-256 | a37331754ab31450a8560c72f4c5146a25f7543c5f9ce6ce243f988c9cbc4382 |