neo4j-bigbang


Nameneo4j-bigbang JSON
Version 0.0.25 PyPI version JSON
download
home_pagehttps://github.com/euonymus/neo4j-bigbang
SummaryThis is a library allows you to import csv data into neo4j database
upload_time2020-11-22 15:58:22
maintainer
docs_urlNone
authoreuonymus
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Neo4j Big Bang the CSV importer for Neo4j
This is a python package to import csv data into neo4j database.
You can import both Nodes and Relationships.
You don't need to write any Cypher script at all.

# What it can do

## Importing Nodes
- This shell automatically detects the types of properties.
- You can choose skipping or updating if nodes already exist.
- You can choose Node labels row by row. Multiple labels are supported.
- You can set labels as your importing file name too.

## Importing Relationships
- This shell automatically detects the types of properties.
- You can choose skipping or updating if relationship already exists.
- You can choose if you want to create nodes at the same time.
- You can choose Relationship type row by row.
- You can set type as your importing file name too.


# Getting Started

## Install this package

```
$ pip install neo4j-bigbang
```

## Prepare CSV Data

Put your importing CSV file under `importing` directory

## Run command with environment variables

```
NEO4J_URI=bolt://localhost:7687 NEO4J_USER=neo4j NEO4J_PASSWORD={your-password} bigbang-node
```

## Or set envilonment variable
```
export NEO4J_URI=bolt://localhost:7687 NEO4J_USER=neo4j NEO4J_PASSWORD=password
```


# Getting Started from source

```bash
$ cd [path to this repo]
$ python -m venv .env
$ source .env/bin/activate
$ pip install -r requirements.txt
```

Setup your .env file under `src/bigbang` directory


/src/bigbang/.env
```
NEO4J_URI='bolt://localhost:7687'
NEO4J_USER='neo4j'
NEO4J_PASSWORD='password'
```

# Import Nodes from CSV

Run

```bash
$ python src/bigbang/import_nodes.py

# Case 1: Use Labels from file name Person|Employee.csv
$ python src/bigbang/import_nodes.py -n Person|Employee.csv -a

# Case 2: Update if target node already exists
$ python src/bigbang/import_nodes.py -n Person|Employee.csv -a -l Person|Teacher -p name|employee_id -u

# Case 2': Update if target node already exists ( labels should be on CSV )
$ python src/bigbang/import_nodes.py -n Person|Employee.csv -a -p name|employee_id -u

# Case 3: Skip if target node already exists
$ python src/bigbang/import_nodes.py -n Person|Employee.csv -a -l Person|Teacher -p name|employee_id

# Case 3': Skip if target node already exists ( labels should be on CSV )
$ python src/bigbang/import_nodes.py -n Person|Employee.csv -a -l -p name|employee_id
```

Options

- `-p` with `specified properties`: Unique Properties. If not set, target property will be 'neme'.
- `-l` with `specified labels` : If set, specified labels will be targeted if already in Neo4j.
- `-n` : Specify CSV file name. Its' required when you set `-f`
- `-a` : Set if you want to use file name as labels. If not set, labels field is required in the CSV file
- `-f` : Force inserting node. -p and -l -u are ignored.
- `-u` : If set, update node when it exists. ( both -l and -p are required )


# Import Relationships from CSV

Run

```bash
$ python src/bigbang/import_relationships.py

# Case 1: Use Type from file name YOUR_RELATION_TYPE.csv
$ python src/bigbang/import_relationships.py -n YOUR_RELATION_TYPE.csv -a

# Case 2: Update if same type relationship already exists
$ python src/bigbang/import_relationships.py -u

# Case 3: Create relationship and nodes at once, even though nodes does not exist
$ python src/bigbang/import_relationships.py -c
```

Options

- `-u` : If set, update relationship when it exists
- `-n` : Specify CSV file name. Its' required when you set `-a`
- `-a` : Set if you want to use file name as relationship type. If not set, type field is required in the CSV file
- `-c` : If you want to create nodes at the same time, use this option




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/euonymus/neo4j-bigbang",
    "name": "neo4j-bigbang",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "euonymus",
    "author_email": "euonymus0220@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/37/7b/b3da206de1140bdab62c307580aa7682b0e0b7f19593e091589d0e8bc0a3/neo4j-bigbang-0.0.25.tar.gz",
    "platform": "",
    "description": "# Neo4j Big Bang the CSV importer for Neo4j\nThis is a python package to import csv data into neo4j database.\nYou can import both Nodes and Relationships.\nYou don't need to write any Cypher script at all.\n\n# What it can do\n\n## Importing Nodes\n- This shell automatically detects the types of properties.\n- You can choose skipping or updating if nodes already exist.\n- You can choose Node labels row by row. Multiple labels are supported.\n- You can set labels as your importing file name too.\n\n## Importing Relationships\n- This shell automatically detects the types of properties.\n- You can choose skipping or updating if relationship already exists.\n- You can choose if you want to create nodes at the same time.\n- You can choose Relationship type row by row.\n- You can set type as your importing file name too.\n\n\n# Getting Started\n\n## Install this package\n\n```\n$ pip install neo4j-bigbang\n```\n\n## Prepare CSV Data\n\nPut your importing CSV file under `importing` directory\n\n## Run command with environment variables\n\n```\nNEO4J_URI=bolt://localhost:7687 NEO4J_USER=neo4j NEO4J_PASSWORD={your-password} bigbang-node\n```\n\n## Or set envilonment variable\n```\nexport NEO4J_URI=bolt://localhost:7687 NEO4J_USER=neo4j NEO4J_PASSWORD=password\n```\n\n\n# Getting Started from source\n\n```bash\n$ cd [path to this repo]\n$ python -m venv .env\n$ source .env/bin/activate\n$ pip install -r requirements.txt\n```\n\nSetup your .env file under `src/bigbang` directory\n\n\n/src/bigbang/.env\n```\nNEO4J_URI='bolt://localhost:7687'\nNEO4J_USER='neo4j'\nNEO4J_PASSWORD='password'\n```\n\n# Import Nodes from CSV\n\nRun\n\n```bash\n$ python src/bigbang/import_nodes.py\n\n# Case 1: Use Labels from file name Person|Employee.csv\n$ python src/bigbang/import_nodes.py -n Person|Employee.csv -a\n\n# Case 2: Update if target node already exists\n$ python src/bigbang/import_nodes.py -n Person|Employee.csv -a -l Person|Teacher -p name|employee_id -u\n\n# Case 2': Update if target node already exists ( labels should be on CSV )\n$ python src/bigbang/import_nodes.py -n Person|Employee.csv -a -p name|employee_id -u\n\n# Case 3: Skip if target node already exists\n$ python src/bigbang/import_nodes.py -n Person|Employee.csv -a -l Person|Teacher -p name|employee_id\n\n# Case 3': Skip if target node already exists ( labels should be on CSV )\n$ python src/bigbang/import_nodes.py -n Person|Employee.csv -a -l -p name|employee_id\n```\n\nOptions\n\n- `-p` with `specified properties`: Unique Properties. If not set, target property will be 'neme'.\n- `-l` with `specified labels` : If set, specified labels will be targeted if already in Neo4j.\n- `-n` : Specify CSV file name. Its' required when you set `-f`\n- `-a` : Set if you want to use file name as labels. If not set, labels field is required in the CSV file\n- `-f` : Force inserting node. -p and -l -u are ignored.\n- `-u` : If set, update node when it exists. ( both -l and -p are required )\n\n\n# Import Relationships from CSV\n\nRun\n\n```bash\n$ python src/bigbang/import_relationships.py\n\n# Case 1: Use Type from file name YOUR_RELATION_TYPE.csv\n$ python src/bigbang/import_relationships.py -n YOUR_RELATION_TYPE.csv -a\n\n# Case 2: Update if same type relationship already exists\n$ python src/bigbang/import_relationships.py -u\n\n# Case 3: Create relationship and nodes at once, even though nodes does not exist\n$ python src/bigbang/import_relationships.py -c\n```\n\nOptions\n\n- `-u` : If set, update relationship when it exists\n- `-n` : Specify CSV file name. Its' required when you set `-a`\n- `-a` : Set if you want to use file name as relationship type. If not set, type field is required in the CSV file\n- `-c` : If you want to create nodes at the same time, use this option\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "This is a library allows you to import csv data into neo4j database",
    "version": "0.0.25",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "30c52c8825dbfccfb610b53db75c3121",
                "sha256": "7df93e5a7b40e7294bc656811573fb36de19318fdb3e7ed107b64995c94c77f6"
            },
            "downloads": -1,
            "filename": "neo4j_bigbang-0.0.25-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "30c52c8825dbfccfb610b53db75c3121",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 22509,
            "upload_time": "2020-11-22T15:58:20",
            "upload_time_iso_8601": "2020-11-22T15:58:20.764945Z",
            "url": "https://files.pythonhosted.org/packages/d6/60/38bfe845d66e724b312a179c3564ede7ede8c07d24d2c72b8d50817df822/neo4j_bigbang-0.0.25-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "08e4290c6a2aa4561bc7f0b26a93ddae",
                "sha256": "a84728d01b70f7eb13766252aad5a59714cb321a79add90f581bd8e2841ddd80"
            },
            "downloads": -1,
            "filename": "neo4j-bigbang-0.0.25.tar.gz",
            "has_sig": false,
            "md5_digest": "08e4290c6a2aa4561bc7f0b26a93ddae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 14401,
            "upload_time": "2020-11-22T15:58:22",
            "upload_time_iso_8601": "2020-11-22T15:58:22.134768Z",
            "url": "https://files.pythonhosted.org/packages/37/7b/b3da206de1140bdab62c307580aa7682b0e0b7f19593e091589d0e8bc0a3/neo4j-bigbang-0.0.25.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-11-22 15:58:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "euonymus",
    "error": "Could not fetch GitHub repository",
    "lcname": "neo4j-bigbang"
}
        
Elapsed time: 0.18317s