Skip to content
/ cstea Public

rettle Fill and Pour Ingredient crate for csv files

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
Apache-LICENSE
MIT
MIT-LICENSE
Notifications You must be signed in to change notification settings

slaterb1/cstea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2bfaf42 · Jan 11, 2020

History

53 Commits
Jan 10, 2020
Jun 29, 2019
Jan 11, 2020
Jan 10, 2020
Jun 16, 2019
Aug 6, 2019
Aug 5, 2019
Aug 5, 2019
Jan 11, 2020
Aug 5, 2019
Jan 11, 2020

Repository files navigation

cstea

LICENSE License Build Status Crates.io Version Minimum rustc version

This is a generic csv file Fill and Pour Ingredient crate for use with the rettle ETL.

Data Structures

  • FillCsvArg: Ingredient params for FillCsTea
  • FillCsTea: Wrapper to simplifiy the creation of the Fill Ingredient to be used in the rettle Pot.
  • PourCsvArg: Ingredient params for PourCsTea
  • PourCsTea: Wrapper to simplifiy the creation of the Pour Ingredient to be used in the rettle Pot.

Example

#[derive(Default, Clone, Debug, Deserialize, Serialize)]
struct CsTea {
    id: i32,
    name: String,
    value: i32
}

impl Tea for CsTea {
    fn as_any(&self) -> &dyn Any {
        self
    }
}

fn main() {
    let test_csvarg = FillCsvArg::new("fixtures/test.csv", 50);
    let test_pour_csvarg = PourCsvArg::new("fixtures/pour.csv");

    let brewery = Brewery::new(4, Instant::now());
    let mut new_pot = Pot::new();
    let fill_cstea = FillCsTea::new::<CsTea>("csv_tea_source", "csv_fixture", test_csvarg);
    let pour_cstea = PourCsTea::new::<CsTea>("csv_pour_test", test_pour_csvarg);

    new_pot = new_pot.add_source(fill_cstea);

    // Steep operations of choice

    new_pot = new_pot.add_ingredient(pour_cstea);

    new_pot.brew(&brewery);
}

About

rettle Fill and Pour Ingredient crate for csv files

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
Apache-LICENSE
MIT
MIT-LICENSE

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages