Crate csv_polars_cleaner

Source
Expand description

§csv_polars_cleaner

A robust Rust library for extracting and cleaning tabular data from messy CSV files using the Polars DataFrame engine.

§Features

  • Automatically skips metadata, comments, and blank lines.
  • Detects the real data region using the mode of column counts.
  • Returns a Polars DataFrame for further analysis.

§Example

use csv_polars_cleaner::parse_file;
// This example will fail unless "data.csv" exists.
let df = parse_file("data.csv", b',');
match df {
    Ok(df) => println!("Headers: {:?}", df.get_column_names()),
    Err(e) => eprintln!("Failed to parse: {e}"),
}

Re-exports§

pub use parser::parse_boxed_data;

Modules§

detector
parser
preprocessor

Functions§

parse_file
Load and parse a single malformed CSV file.
parse_folder
Parse all CSV files in a folder into a vector of Polars DataFrames.