Crates.io | marc-record |
lib.rs | marc-record |
version | 0.5.1 |
source | src |
created_at | 2024-10-31 15:37:27.993312 |
updated_at | 2024-10-31 16:37:51.11172 |
description | A MARC21 parser supporting MARC-8 text encoding |
homepage | |
repository | https://github.com/demarque/marc-record |
max_upload_size | |
id | 1430260 |
size | 484,373 |
A Rust library for parsing MARC records, specifically using the MARC21 format, with either UTF-8 or MARC-8 encoding. This library has been tested on a bunch of records from a single provider and various samples found in the wild. Since MARC is an open standard with many variations, we may not support all the files. In particular, we do not support MARCXML at the moment.
Add the crate to your rust library:
cargo install marc-record
Load, parse and inspect a record:
let mut contents = Vec::new();
File::open(path_to_my_file)?.read_to_end(&mut contents)?;
let records = marc_record::parse_records(&contents)?;
println!("File contains {} records", records.len());
marc-record
is distributed under the terms of the MIT license.