A Rust plugin for ARO that provides CSV parsing and formatting functionality.
aro add git@github.com:arolang/plugin-rust-csv.gitRequires Rust 1.75 or later.
cargo build --releaseParses a CSV string into an array of arrays.
Input:
data(string): CSV data to parseheaders(boolean, optional): Whether the first row contains headers. Default: true
Output:
rows: Array of arrays containing the parsed datarow_count: Number of rows (including header if present)
Formats an array of arrays as a CSV string.
Input:
rows(array): Array of arrays to formatdelimiter(string, optional): Field delimiter. Default: ","
Output:
csv: The formatted CSV string
Converts CSV data to an array of JSON objects.
Input:
data(string): CSV data with headers in the first row
Output:
objects: Array of JSON objectscount: Number of objects
(* Parse CSV data *)
(Parse CSV Data: Data Processing) {
<Extract> the <csv-data> from the <request: body>.
<ParseCsv> the <parsed> with <csv-data>.
<Return> an <OK: status> with <parsed>.
}
MIT