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§
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.