Skip to main content


QueryBuilder Objects

class QueryBuilder(DeclarativeBase)


def load_csv(path: str, header: bool, row: str) -> "DeclarativeBase"

Load data from a CSV file by executing a Cypher query for each row.


  • path - A string representing the path to the CSV file.
  • header - A bool indicating if the CSV file starts with a header row.
  • row - A string representing the name of the variable for iterating over each row.


A DeclarativeBase instance for constructing queries.


Load CSV with header:

  • Python - load_csv(path="path/to/my/file.csv", header=True, row="row").return_().execute()

  • Cypher - LOAD CSV FROM 'path/to/my/file.csv' WITH HEADER AS row RETURN *;

    Load CSV without header:

  • Python - load_csv(path='path/to/my/file.csv', header=False, row='row').return_().execute()

  • Cypher - LOAD CSV FROM 'path/to/my/file.csv' NO HEADER AS row RETURN *;