Skip to content

About

A generic reader for csv and json data

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

118 Commits

Folders and files

Repository files navigation

GitHub Workflow Status codecov

readervzrd

Readervzrd is a Rust library that provides utilities for reading tabular data from files without worrying if they are formatted as CSV, JSON or Parquet. It offers flexible functionality to extract headers and iterate over records, supporting different file formats and structures.

Features

  • Supports uniform reading of data from CSV, JSON and Parquet files.
  • Supports gzip compressed CSV, TSV and JSON files (e.g. data.csv.gz).
  • Extracts headers from files.
  • Iterate over records
  • Handling of nested JSON structures

Installation

To use readervzrd in your Rust project, add it as a dependency in your Cargo.toml file:

[dependencies]
readervzrd = "0.1.0"

Usage

use readervzrd::{FileReader, FileError};

fn main() -> Result<(), FileError> {
    // Create a FileReader for a CSV file with ',' delimiter
    let mut reader = FileReader::new("data.csv", Some(','))?;

    // Create another FileReader for a JSON file
    let mut another_reader = FileReader::new("data.json", None)?;

    // Create another FileReader for a Parquet file
    let mut parquet_reader = FileReader::new("data.parquet", None)?;

    // Create another FileReader for a gzip compressed CSV file
    let mut gz_reader = FileReader::new("data.csv.gz", Some(','))?;

    // Get headers from the file
    let headers = reader.headers()?;
    println!("Headers: {:?}", headers);

    // Iterate over records and process them
    for record in reader.records()? {
        println!("Record: {:?}", record);
    }

    Ok(())
}

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or create a pull request on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A generic reader for csv and json data

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages