18 releases

0.1.17 Jul 3, 2021
0.1.16 Jul 3, 2021
0.1.15 Jun 16, 2021
0.1.1 May 1, 2021

#2670 in Parser implementations

MIT license

105KB
2.5K SLoC

CSVX

Crates.io Crates.io docs.rs

CSVX is an extension of CSV format. This extension allows you to use CSV as a spreadsheet.

Example

extern crate csvx;

use csvx::Table;
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    let raw_csv = "pi,3^5,\"ref(0,0)\",-(1/0)
12%5,\"pow(3,5)\",0/NaN,\"\"\"Apollo\"\"\"
A1+A2,\"if(true , sqrt(25),round(if(false,1.1,2.5)))\",D2+1969,";
    println!("RAW CSV DATA:\n{}\n", raw_csv);

    let mut table = Table::new(raw_csv)?;
    println!("CALCULATED TABLE:\n{}", table);

    table.update(0, 0, "true")?;
    println!("UPDATED TABLE:\n{}", table.export_calculated_table()?);

    table.insert_y(0);
    println!("RAW TABLE:\n{}", table.export_raw_table()?);

    Ok(())
}

lib.rs:

CSVX - API Documentation -

CSVX is an extension of CSV format. this extension allows you to use CSV as a spreadsheet.

Further documentation can be found in the repository on GitHub.

https://github.com/yujixr/csvx

Example

extern crate csvx;

use csvx::Table;
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    let raw_csv = "pi,3^5,\"ref(0,0)\",-(1/0)
12%5,\"pow(3,5)\",0/NaN,\"\"\"Apollo\"\"\"
A1+A2,\"if(true , sqrt(25),round(if(false,1.1,2.5)))\",D2+1969,";
    println!("RAW CSV DATA:\n{}\n", raw_csv);

    let mut table = Table::new(raw_csv)?;
    println!("CALCULATED TABLE:\n{}", table);

    table.update(0, 0, "true")?;
    println!("UPDATED TABLE:\n{}", table.export_calculated_table()?);

    table.insert_y(0);
    println!("RAW TABLE:\n{}", table.export_raw_table()?);

    Ok(())
}

Dependencies

~1.5–2.3MB
~35K SLoC