Crates.io | shr_parser |
lib.rs | shr_parser |
version | 1.0.6 |
source | src |
created_at | 2024-07-11 09:00:34.486698 |
updated_at | 2024-07-12 13:47:48.901817 |
description | Parses sweeps from a Signal Hound Spike file. |
homepage | |
repository | https://github.com/Xerrion/shr_parser |
max_upload_size | |
id | 1299323 |
size | 69,913 |
This Rust library provides powerful tools for parsing and handling SHR files generated by the Signal Hound Spike softwa. The SHR file format encompasses a file header and multiple sweeps, each with its own header and data. This library leverages memory mapping for efficient file reading and Rayon for parallel processing of sweeps, ensuring high performance and scalability.
To include this library in your project, add the following dependencies to your Cargo.toml
file:
[dependencies]
shr_parser = "1.0.5"
Here's an example of how to use the SHR file parser:
use std::path::PathBuf;
use shr_parser::{SHRParser, SHRParsingType};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let file_path = PathBuf::from("path/to/your/shrfile.shr");
let parser = SHRParser::new(file_path, SHRParsingType::Peak)?;
println!("{}", parser.to_str());
parser.to_csv(PathBuf::from("output.csv"))?;
Ok(())
}
Complete documentation is available on docs.rs. To generate the documentation locally, run:
cargo doc --open
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the GPL-3 License. See the LICENSE
file for details.