python_cypher.py

class python_cypher.CypherParserBaseClass[source]

Base class that specific parsers will inherit from. Certain methods must be defined in the child class. See the docs.

create_query(graph_object, parsed_query)[source]

For executing queries of the form CREATE... RETURN.

matching_nodes(graph_object, parsed_query)[source]

For executing queries of the form MATCH... [WHERE...] RETURN...

parse(query)[source]

Calls yacc to parse the query string into an AST.

query(graph_object, query_string)[source]

Top-level function that’s called by the parser when a query has been transformed to its AST. This function routes the parsed query to a smaller number of high-level functions for handing specific types of queries (e.g. MATCH, CREATE, ...)

class python_cypher.CypherToNetworkx[source]

Child class inheriting from CypherParserBaseClass to hook up Cypher functionality to NetworkX.

python_cypher.random_hash()[source]

Return a random hash for naming new nods and edges.

python_cypher.unique_id()[source]

Call random_hash and prepend _id_ to it.