test_match v0.1.0 TestMatch.Import

Module for importing CSV data from priv/csv/.

Link to this section Summary

Functions

Reads a CSV nodes_file and adds vertexes to the Graph g that is passed.

Reads a CSV relationships_file and adds edges to the Graph g that is passed.

Link to this section Functions

Link to this function

read_nodes_file(g, nodes_file)

Reads a CSV nodes_file and adds vertexes to the Graph g that is passed.

The nodes_file is found at the @csv_dir location.

Examples

iex> import TestMatch.Import
TestMatch.Import

iex> g = Graph.new()
#Graph<type: directed, vertices: [], edges: []>

iex> g = read_nodes_file(g, "sw-nodes.csv")
#Graph<type: directed, vertices: ["py4j", "jpy-client", "matplotlib",
 "nbconvert", "python-dateutil", "six", "jpy-console", "pyspark", "pytz",
 "spacy", "jupyter", "pandas", "ipykernel", "jpy-core", "numpy"], edges: []>
Link to this function

read_relationships_file(g, relationships_file)

Reads a CSV relationships_file and adds edges to the Graph g that is passed.

The relationships_file is found at the @csv_dir location.

Examples

iex> g = read_relationships_file(g, "sw-relationships.csv")
#Graph<type: directed, vertices: ["py4j", "jpy-client", "matplotlib",
 "nbconvert", "python-dateutil", "six", "jpy-console", "pyspark", "pytz",
 "spacy", "jupyter", "pandas", "ipykernel", "jpy-core",
 "numpy"], edges: ["jpy-client" -[DEPENDS_ON]-> "jpy-core", "matplotlib" -[DEPENDS_ON]-> "python-dateutil", "matplotlib" -[DEPENDS_ON]-> "six", "matplotlib" -[DEPENDS_ON]-> "pytz", "matplotlib" -[DEPENDS_ON]-> "numpy", "nbconvert" -[DEPENDS_ON]-> "jpy-core", "python-dateutil" -[DEPENDS_ON]-> "six", "jpy-console" -[DEPENDS_ON]-> "jpy-client", "jpy-console" -[DEPENDS_ON]-> "ipykernel", "pyspark" -[DEPENDS_ON]-> "py4j", "spacy" -[DEPENDS_ON]-> "six", "spacy" -[DEPENDS_ON]-> "numpy", "jupyter" -[DEPENDS_ON]-> "nbconvert", "jupyter" -[DEPENDS_ON]-> "jpy-console", "jupyter" -[DEPENDS_ON]-> "ipykernel", "pandas" -[DEPENDS_ON]-> "python-dateutil", "pandas" -[DEPENDS_ON]-> "pytz", "pandas" -[DEPENDS_ON]-> "numpy"]>