Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neo4j_uploader-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

neo4j_uploader-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

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

Hashes for neo4j_uploader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f6c752c71bd487110a81e1650c16a520ca59ed0f16d6cf8e688064b715358168
MD5 c272c44ee250015ef21cc01840a3c20a
BLAKE2b-256 75b38e5ec7947cd87aa2341e83d6dfd8e3ff48821aa46acd88cb6d92723e0596

See more details on using hashes here.

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

Hashes for neo4j_uploader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12827f6766e9916b6a8f3c78d6de8e4bf1ac622081bfc1bf4c53f1525efd3a46
MD5 f137d6f4559a8a766a8ba107a73dbc9d
BLAKE2b-256 a37331754ab31450a8560c72f4c5146a25f7543c5f9ce6ce243f988c9cbc4382

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