Skip to content

MRRC

A Rust library for MARC bibliographic records, with Python bindings.

What MRRC Does

  • Reads and writes ISO 2709 (MARC21) binary format
  • Provides Python bindings with a pymarc-compatible API
  • Supports multiple serialization formats (JSON, XML, CSV, Dublin Core, MODS, BIBFRAME)
  • Handles MARC-8 and UTF-8 character encodings

Performance

In benchmarks (see methodology):

  • Python: ~4x throughput compared to pymarc
  • Rust: ~1M records/sec

Quick Example

from mrrc import MARCReader

for record in MARCReader("records.mrc"):
    print(record.title())
use mrrc::MarcReader;
use std::fs::File;

let file = File::open("records.mrc")?;
let mut reader = MarcReader::new(file);
while let Some(record) = reader.read_record()? {
    if let Some(title) = record.title() {
        println!("{}", title);
    }
}

Getting Started

pymarc Users

MRRC's Python API is similar to pymarc but not identical. See the migration guide for specific differences.

Status

This library is experimental. APIs may change between versions.