Skip to content

Commit ca37b36

Browse files
committed
README update
1 parent 1bc6915 commit ca37b36

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

README.md

+48-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Neo4j-uploader
2-
For uploading specially formatted dictionary data to a Neo4j database instance
2+
For uploading specially formatted dictionary data to a specific Neo4j database instance
33

44
## Dictionary Format
55
Either a .json or dictionary can be passed as an arg into the upload() function.
@@ -9,4 +9,50 @@ The value for the `nodes` key must be a dictionary, where each key is the primar
99

1010
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.
1111

12-
See the `samples/data.json` file for an example.
12+
Every record dictionary must have `_uid` key and the relationships must have a `_from__uid` and `_to__uid` key.
13+
14+
Example .json:
15+
```
16+
{
17+
"nodes": {
18+
"Person": [
19+
{
20+
"first_name": "Jaclyn",
21+
"last_name": "Stacey",
22+
"email": "{'reference': ['first_name']}.{'reference': ['last_name']}@email.com",
23+
"_uid": "b267e10d-998b-4804-b5a5-fe84b9ee982a"
24+
},
25+
{
26+
"first_name": "Ryan",
27+
"last_name": "Adam",
28+
"email": "{'reference': ['first_name']}.{'reference': ['last_name']}@email.com",
29+
"_uid": "0053fd25-71e4-40c1-80ff-f6b7e4211c77"
30+
}
31+
]
32+
},
33+
"relationships": {
34+
"LIVES_WITH": [
35+
{
36+
"_from__uid": "b267e10d-998b-4804-b5a5-fe84b9ee982a",
37+
"_to__uid": "0053fd25-71e4-40c1-80ff-f6b7e4211c77",
38+
"_uid": "9db12425-0eba-47cf-8654-84ad235f98c1"
39+
}
40+
]
41+
}
42+
}
43+
```
44+
45+
## Usage
46+
`pip install neo4j-uploader`
47+
48+
In your application
49+
```
50+
from neo4j_uploader import upload
51+
52+
credentials = ("database_uri", "user", "password")
53+
data = ...<dictionary_or_json_payload>
54+
upload(credentials, data)
55+
```
56+
57+
## Limitations
58+
This package currently requires the .json data payload to be strictly formatted to the above requirements.

0 commit comments

Comments
 (0)