Skip to main content

No project description provided

Project description

Neo4j-uploader

For uploading specially formatted dictionary data to a Neo4j database instance.

Installation

pip install neo4j-uploader

Usage

from neo4j_uploader import batch_upload

config = {
    "neo4j_uri": "<NEO4J_URI>",
    "neo4j_user": "<NEO4J_USER>",
    "neo4j_password": "<NEO4J_PASSWORD>",
    "overwrite": true
}

data = {
    "nodes": [
        {
            "labels":["Person"],
            "key":"uid",
            "records":[
                {
                    "uid":"abc",
                    "name": "John Wick"
                },
                {
                    "uid":"bcd",
                    "name":"Cane"
                }
            ]
        },
        {
            "labels":["Dog"],
            "key": "gid",
            "records":[
                {
                    "gid":"abc",
                    "name": "Daisy"
                }
            ]
        }
    ],
    "relationships": [
        {
            "type":"loves",
            "from_node": {
                "record_key":"_from_uid",
                "node_key":"uid",
                "node_label":"Person"
            },
            "to_node": {
                "record_key":"_to_gid",
                "node_key":"gid",
                "node_label": "Dog"
            },
            "exclude_keys":["_from_uid", "_to_gid"],
            "records":[
                {
                    "_from_uid":"abc",
                    "_to_gid":"abc"
                }
            ]
        }
    ]
}

result = batch_upload(config, data)

The original upload function using the simpler schema also still works:

from neo4j_uploader import upload

credentials = ("database_uri", "user", "password")
data = {
  "nodes":
  {
    "Person": [
      {"name": "Bob", "age": 30},
      {"name": "Jane", "age": 25}
    ]
  },
  "relationships":
  {
    "KNOWS": [
      {"_from_name": "Bob", "_to_name": "Jane", "since": 2015}
    ]
  }
}
upload(credentials, data, node_key="name)

Documentation

Documentation for the current version.

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

Uploaded Source

Built Distribution

neo4j_uploader-0.5.4-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: neo4j_uploader-0.5.4.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.2 Darwin/23.4.0

File hashes

Hashes for neo4j_uploader-0.5.4.tar.gz
Algorithm Hash digest
SHA256 bf0ab0bf82cfadf55944ea2a9b7c5dbc6f14486d2281a4e0551c9e22948a5ca6
MD5 f9a047266845cbf4ab20a9850e872c78
BLAKE2b-256 22f306e33d38a4b1647d94a404f303af9e685a1b6dd0830c8dd10d1a793b4351

See more details on using hashes here.

File details

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

File metadata

  • Download URL: neo4j_uploader-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.2 Darwin/23.4.0

File hashes

Hashes for neo4j_uploader-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e15a0a9a33b64e053caaffbfad4cf0bb3574d80948f5bc9335859969e0a870aa
MD5 af2ae09c0ebc39c2e25e2b430e989ca2
BLAKE2b-256 66149299d0cfcaccdeace2c6aa233b6e478bae1d5d5165e958bc420c3f1ccf00

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