Project Backend.
1.7K
Processes and queries supplied CSV files using a comprehensive graph model.
This repo has been implemented with conscious effort to enable further extension easily through forking,should a need arise for an additional node or changing to an existing node.
This API is capable of returning multiple csvs from the same or separate data streams and as it works on a copy of the contents at each stage will never impact the input data.
Docker Hub: qub40232046/40232046-graphical-processing-be
docker run -d -p 8080:8080 -e APP_FRONTEND="{space-separated-list-cors-urls-allowed}" qub40232046/40232046-graphical-processing-be:{tag}
Note the APP_FRONTEND variable defaults to http://localhost:3000 so to enable quick running of the paired frontend application locally.
curl --location --request POST 'http://localhost:8080/process' \
--form 'csvFiles=@"/redacted/Scores.csv"' \
--form 'graph="{
\"defaultValues\": {},
\"nodes\": [
{
\"id\": \"0\",
\"group\": \"file\",
\"operation\":\"open_file\",
\"name\": \"Scores.csv\"
},
{
\"id\": \"1\",
\"group\": \"processing\",
\"operation\": \"filter\",
\"filterType\": \"less_than\",
\"column\": \"Score\",
\"condition\": \"40\",
\"equal\": \"true\"
},
{
\"id\": \"2\",
\"group\": \"file\",
\"operation\": \"write_file\",
\"name\": \"Output.csv\"
}
],
\"edges\": [
{
\"from\": \"0\",
\"to\": \"1\"
},
{
\"from\": \"1\",
\"to\": \"2\"
}
]
}";type=application/json'
Files: 1 or more to be supplied - matching number of open file nodes.
Graph: contains the following:
On a merge of any type, checks are taken to ensure cells don't lose genuine data. Genuine data is considered cells with non-empty string content.
Each node will output a single csv result. This is then able to be used as input into any number of non-dependent nodes.
That is to emphasise you cannot have loops in the supplied graph
Description: Prefixes supplied alias onto the columns of the supplied csv.
Inputs: 1 csv file (will remove existing alias on any of the columns if present).
Outputs: Copy of csv with the new identifier prefixed to column headers.
Attributes: 1
Exceptions if:
Description: Calculate the count, min, max, average or sum of a specified column.
Inputs: 1 csv file (will remove existing alias on any of the columns if present).
Outputs: Csv with just the calculated value.
Attributes: 2
Exceptions if:
Description: Creates a suffixed column on csv in the order of first column value + second column value.
Inputs: 1 csv file.
Outputs: Copy of csv with the new column suffixed csv.
Attributes: 3
Exceptions if:
Description: Takes 2 input csvs and produces single csv with number of rows matching sum of two inputs rows. Headers are merged to avoid duplicate headers.
Inputs: 2 csv files.
Outputs: A table of the two inputs.
Attributes: 0
Description: Removes any identifier alias on the columns of the input csv.
Inputs: 1 csv file.
Outputs: Copy of csv with de-aliased column headers.
Attributes: 0
Exceptions if:
Description: Removes the blacklist of columns from the resultant csv.
Inputs: 1 csv file.
Outputs: Copy of csv with only rows unspecified.
Attributes: 1
Exceptions if:
Description: Filter for equality or an inequality.
Inputs: 1 csv file.
Outputs: Copy of csv with only rows matching or not matching filter depending on equal boolean.
Attributes: 4
Exceptions if:
Description: Join two csv files on commonality of two columns.
Inputs: 2 csv files.
Outputs: Joined csv of the two input csvs as per the join type chosen
(duplicate headers are possible and user must mitigate this if problem).
Attributes: 3
Exceptions if:
Description: Limit number of rows in the supplied csv.
Inputs: 1 csv file.
Outputs: Copy of input csv with specified number of rows.
Attributes: 1
Exceptions if:
Description: Merge two columns into one in the position of the first column.
Inputs: 1 csv file.
Outputs: Copy of input csv with the specified columns merged.
Attributes: 4
Exceptions if:
Description: Merge rows which hold value in the column specified into one.
Inputs: 1 csv file.
Outputs: Copy of input csv with the rows merged.
Attributes: 2
Exceptions if:
Description: Node to represent supplied file by setting name to filename.
Inputs: 0 csv file.
Outputs: Copy of input csv supplied in request.
Attributes: 1
Description: Logical or node. To be applied on two filter nodes enabling logical or.
Inputs: 2 csv files.
Outputs: Concatenation of the two input csvs and unique column applied to avoid duplicate entries matching both filter expressions.
Attributes: 1
Exceptions if:
Description: Orders specified column as per order type supplied.
Inputs: 1 csv file.
Outputs: Copy of input csv with rows ordered as specified.
Attributes: 2
Exceptions if:
Description: Renames the specified column in the supplied csv.
Inputs: 1 csv file.
Outputs: Copy of input csv with the specified columns merged.
Attributes: 2
Exceptions if:
Description: Add, subtract, multiply, divide or modulo of either two columns or one column and a literal.
Inputs: 1 csv file.
Outputs: Copy of csv with an additional column suffixed which takes the value in column1 and applies the column or literal in value.
Attributes: 5
Exceptions if:
Description: Calculate the count, min, max, average or sum of a specified columns of a row.
Inputs: 1 csv file.
Outputs: Copy of csv with an additional column suffixed.
Attributes: 3
Exceptions if:
Description: Returns the complementary set of subset compared to super set using key header as indicator for which fields are present. Note bigger csv supplied assumed as super set. Worthy of note is that the assumption is the column specified is unique.
Inputs: 2 csv files.
Outputs: Complementary set of the subset compared to the super set. If either set passed in is empty it will output the csv passed as the outer set.
Attributes: 1
Exceptions if:
Description: Takes the whitelist of columns from the resultant csv.
Inputs: 1 csv file.
Outputs: Copy of csv with only rows specified.
Attributes: 1
Exceptions if:
Description: Merges the rows with matching value in specified column into one row.
Inputs: 1 csv file.
Outputs: Copy of csv with only unique rows on the column specified.
Attributes: 1
Exceptions if:
Description: Renames input file and ensures it is in the returned files in response. Useful in debugging queries too.
Inputs: 1 csv file.
Outputs: Copy of input csv.
Attributes: 1
Content type
Image
Digest
sha256:355599a60…
Size
91 MB
Last updated
over 2 years ago
docker pull qub40232046/40232046-graphical-processing-be