czv/czv
2024-06-20 16:47:39 -04:00
..
benches feat: add czv, czv-wasm, and czv-python (init release) 2024-06-19 22:55:19 -04:00
examples docs: use top-level RowCount & show types 2024-06-20 16:47:39 -04:00
src refactor: use options object for WASM function args, improve docs 2024-06-20 16:28:53 -04:00
tests refactor: use options object for WASM function args, improve docs 2024-06-20 16:28:53 -04:00
.gitignore feat: add czv, czv-wasm, and czv-python (init release) 2024-06-19 22:55:19 -04:00
Cargo.toml refactor: use czv in czv-python 2024-06-20 01:03:54 -04:00
README.md refactor: use options object for WASM function args, improve docs 2024-06-20 16:28:53 -04:00

czv

Rust library for czv. czv is a library of CSV-related operations for data engineering and analysis tasks.

Usage

To install czv, run:

cargo install czv

Let's say we want to print the total number of rows in a 4x3 CSV file fruits.csv including the header row:

use czv::{RowCount, Result};

fn main() -> Result<()> {
    let data = "\
fruits,price
apple,2.50
banana,3.00
strawberry,1.50
";
    let output = RowCount::new()
        .file_data(data)
        .include_header_row(true)
        .execute()?;
    println!("{output}"); // 4
    Ok(())
}

When ran, this should be the standard output printed in the terminal:

4

Tests

To run the tests, run:

cargo test

Benchmarks

To run the benchmarks, run:

cargo bench

For benchmarks we use criterion.rs.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.