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

Uploaded Source

Built Distribution

neo4j_uploader-0.2.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file neo4j_uploader-0.2.0.tar.gz.

File metadata

  • Download URL: neo4j_uploader-0.2.0.tar.gz
  • Upload date:
  • Size: 5.3 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.2.0.tar.gz
Algorithm Hash digest
SHA256 9c489a83c0aacb2c286a2e9a7f75aa9a8d8f07b16be4d9020f0a0d386f0d3cf1
MD5 fdfe8d2542e454fc928d5fb892b90a87
BLAKE2b-256 d9042ae9258a6af12d09f5f9b2bfd1ad17b3a7aa9325aba755a76f4b9e97f751

See more details on using hashes here.

File details

Details for the file neo4j_uploader-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: neo4j_uploader-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 310f7cf523465a7d67afad18a87a10f3125a30208fb77ac576e3d83eb557c88e
MD5 832d378e672b324fe63222ce99e51a8b
BLAKE2b-256 efcf28e0761bc3770ccc66f690a4ca0d2f1bd4ef8eddf1aa3978c62c65859412

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