baskerville

Crates.iobaskerville
lib.rsbaskerville
version0.3.0
sourcesrc
created_at2023-09-06 10:44:22.562615
updated_at2024-03-03 20:51:32.311067
descriptionInfer and validate data-type schemas in Rust.
homepagehttps://github.com/jaynewey/baskerville
repositoryhttps://github.com/jaynewey/baskerville
max_upload_size
id965167
size1,543,475
Jay Newey (jaynewey)

documentation

README


Crates.io docs.rs GitHub

Infer and validate data-type schemas in Rust and Python.

RustPython

Installation

cargo add baskerville

Example

# 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    │         │
╰──────┴─────────┴─────────╯

Contributing

Versioning

The repo bases versioning from Conventional Commits

Commit count: 11

cargo fmt