falkordb package
Subpackages
Submodules
falkordb.edge module
falkordb.exceptions module
falkordb.execution_plan module
- class falkordb.execution_plan.ExecutionPlan(plan)[source]
Bases:
objectExecutionPlan Class for representing a collection of operations.
- Attributes:
plan (list): List of strings representing the collection of operations. structured_plan (Operation): Root of the structured operation tree.
- class falkordb.execution_plan.Operation(name: str, args: str | None = None, profile_stats: ProfileStats | None = None)[source]
Bases:
objectOperation Class for representing a single operation within an execution plan.
- Attributes:
name (str): The name of the operation. args (str): Operation arguments. children (list): List of child operations. profile_stats (ProfileStats): Profile statistics for the operation.
- append_child(child)[source]
Appends a child operation to the current operation.
- Args:
child (Operation): The child operation to append.
- Returns:
Operation: The updated operation instance.
- child_count() int[source]
Returns the number of child operations.
- Returns:
int: Number of child operations.
- property execution_time: float
returns operation’s execution time in ms
- property records_produced: int
returns number of records produced by operation.
- class falkordb.execution_plan.ProfileStats(records_produced: int, execution_time: float)[source]
Bases:
objectProfileStats Class for representing runtime execution statistics of an operation.
- Attributes:
records_produced (int): The number of records produced. execution_time (float): The execution time in milliseconds.
falkordb.falkordb module
falkordb.graph module
falkordb.graph_schema module
- class falkordb.graph_schema.GraphSchema(graph)[source]
Bases:
objectThe graph schema. Maintains the labels, properties and relationships of the graph.
- get_label(idx: int) str[source]
Returns a label by its index.
- Args:
idx (int): The index of the label.
- Returns:
str: The label.
- get_property(idx: int) str[source]
Returns a property by its index.
- Args:
idx (int): The index of the property.
- Returns:
str: The property.
- get_relation(idx: int) str[source]
Returns a relationship type by its index.
- Args:
idx (int): The index of the relation.
- Returns:
str: The relationship type.
falkordb.helpers module
- falkordb.helpers.quote_string(v)[source]
FalkorDB strings must be quoted, quote_string wraps given v with quotes incase v is a string.
- falkordb.helpers.stringify_param_value(value)[source]
turn a parameter value into a string suitable for the params header of a Cypher command you may pass any value that would be accepted by json.dumps()
ways in which output differs from that of str(): * strings are quoted * None –> “null” * in dictionaries, keys are wrapped in backticks so that non-bare-
identifier keys (e.g.
@type, hyphenated UUIDs) are accepted by the Cypher parser. Empty keys and keys containing a literal backtick raiseValueErrorbecause FalkorDB’s CYPHER header parser does not support escaped backticks inside identifiers.- Parameters:
value – the parameter value to be turned into a string
- Returns:
string