Crates.io | baskerville |
lib.rs | baskerville |
version | 0.3.0 |
source | src |
created_at | 2023-09-06 10:44:22.562615 |
updated_at | 2024-03-03 20:51:32.311067 |
description | Infer and validate data-type schemas in Rust. |
homepage | https://github.com/jaynewey/baskerville |
repository | https://github.com/jaynewey/baskerville |
max_upload_size | |
id | 965167 |
size | 1,543,475 |
cargo add baskerville
# mascots.csv
Name,LOC,Species
Ferris,42,Crab
Corro,7,Urchin
use baskerville::{infer_csv_with_options, CsvInput, InferOptions};
fn main() {
let fields = infer_csv_with_options(
CsvInput::Path("mascots.csv"),
&mut InferOptions {
has_headers: true,
..InferOptions::default()
},
)
.unwrap();
println!("{fields}");
}
Output:
╭──────┬─────────┬─────────╮
│ Name │ LOC │ Species │
├──────┼─────────┼─────────┤
│ Text │ Integer │ Text │
│ │ Float │ │
│ │ Text │ │
╰──────┴─────────┴─────────╯
The repo bases versioning from Conventional Commits