Package: neo4j-bigbang
Neo4j Big Bang the CSV importer for Neo4jThis 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 doImporting NodesThis 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 RelationshipsThis 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 StartedInstall this package$ pip install neo4j-bigbangPrepare CSV DataPut your importing CSV file underimportingdirectoryRun command with environment variablesNEO4J_URI=bolt://localhost:7687 NEO4J_USER=neo4j NEO4J_PASSWORD={your-password} bigbang-nodeOr set envilonment variableexport NEO4J_URI=bolt://localhost:7687 NEO4J_USER=neo4j NEO4J_PASSWORD=passwordGetting Started from source$cd[pathtothisrepo]$python-mvenv.env
$source.env/bin/activate
$pipinstall-rrequirements.txtSetup your .env file undersrc/bigbangdirectory/src/bigbang/.envNEO4J_URI='bolt://localhost:7687'
NEO4J_USER='neo4j'
NEO4J_PASSWORD='password'Import Nodes from CSVRun$pythonsrc/bigbang/import_nodes.py# Case 1: Use Labels from file name Person|Employee.csv$pythonsrc/bigbang/import_nodes.py-nPerson|Employee.csv-a# Case 2: Update if target node already exists$pythonsrc/bigbang/import_nodes.py-nPerson|Employee.csv-a-lPerson|Teacher-pname|employee_id-u# Case 2': Update if target node already exists ( labels should be on CSV )$pythonsrc/bigbang/import_nodes.py-nPerson|Employee.csv-a-pname|employee_id-u# Case 3: Skip if target node already exists$pythonsrc/bigbang/import_nodes.py-nPerson|Employee.csv-a-lPerson|Teacher-pname|employee_id# Case 3': Skip if target node already exists ( labels should be on CSV )$pythonsrc/bigbang/import_nodes.py-nPerson|Employee.csv-a-l-pname|employee_idOptions-pwithspecified properties: Unique Properties. If not set, target property will be 'neme'.-lwithspecified 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 CSVRun$pythonsrc/bigbang/import_relationships.py# Case 1: Use Type from file name YOUR_RELATION_TYPE.csv$pythonsrc/bigbang/import_relationships.py-nYOUR_RELATION_TYPE.csv-a# Case 2: Update if same type relationship already exists$pythonsrc/bigbang/import_relationships.py-u# Case 3: Create relationship and nodes at once, even though nodes does not exist$pythonsrc/bigbang/import_relationships.py-cOptions-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