neo4j
Neo4jClient(uri='neo4j://localhost:7687', neo4j_user='neo4j', neo4j_password='neo4j', database='neo4j')
setup Neo4j driver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri |
str
|
URI of the Neo4j server. Defaults to |
'neo4j://localhost:7687'
|
neo4j_user |
str
|
Neo4j username. |
'neo4j'
|
neo4j_password |
str
|
Neo4j password. |
'neo4j'
|
database |
str
|
Name of the database. |
'neo4j'
|
Attributes:
| Name | Type | Description |
|---|---|---|
driver |
Union[Neo4jDriver, BoltDriver]
|
|
database |
str
|
name of the database to use. |
Source code in db/neo4j.py
create(force=False)
Helper function to create a database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
force |
bool
|
If True, the database will be dropped if it already exists. |
False
|
Source code in db/neo4j.py
read(cypher, **kwargs)
Helper function to read from the database. Streams all records in the query into a list of dictionaries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cypher |
str
|
Query to read from the database. |
required |
**kwargs |
Parameters to pass to the Cypher query. |
{}
|
Source code in db/neo4j.py
read_tx(tx_func, **kwargs)
Helper function to read from the database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tx_func |
Callable
|
A transaction function to run. |
required |
**kwargs |
Keyword arguments to pass to |
{}
|
Source code in db/neo4j.py
write(cypher, **kwargs)
Helper function to write to the database. Ignores returned output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cypher |
str
|
Query to write to the database. |
required |
**kwargs |
Keyword arguments to pass to :meth: |
{}
|