Skip to content

eugene-bulkin/retrosheet-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

retrosheet-rs Build Status codecov crates.io

retrosheet is a Rust crate for parsing event data from Retrosheet, a baseball statistics aggregator. Currently, it only supports parsing the .EVX files that store a sequence of metadata and play-by-play data.

Using retrosheet is fairly straightforward, and most information can be gleaned by looking at the documentation or at Retrosheet's event file specification, although the latter is somewhat incomplete.

To use the parser, provide the byte-data of one or more games (e.g. from reading an EVX file) and use the parse method on the parser. This will return a vector of Game objects which store a variety of data, described in the documentation. For example:

let buf: Vec<u8>; // some buffer which may have been read into by a file
let mut parser = Parser::new();
match parser.parse(&buf) {
    Ok(ref games) => {
        for game in games {
            // Do something with the game here
        }
    },
    Err(ref e) => {
        panic!("Oh no! An error occurred: {}", e);
    }
}

About

A Rust interface for reading Retrosheet data.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages