NimMarc

Marc21 parser for Nimlang

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install NimMarc
choosenim install NimMarc
git clone https://github.com/rsirres/NimMarc

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
NimMarc - - - - - - -

Source

Repository https://github.com/rsirres/NimMarc
Homepage https://github.com/rsirres/NimMarc
Registry Source nimble_official

README

Marc21 Parser for Nim Lang

Implementation of a marc21 parse for nimlang. It is heavily based on pymarc as nim and python are so similar.

Some toy benchmarks on OSX with large marc files show that this implementation is (unsurprisingly) 3-4x faster than pymarc.

Basic Usage Example

Save the following code snippet in file: my_reader.nim

import reader
import record

var r = newReader("<path_to_marc>/my_file.marc")

for record in iter(r):
    echo record.toString()

Run the cmd in terminal/cmd:

nim c -r my_reader.nim

Looking for marc file to test this library?

cd data
wget https://www.lib.umich.edu/files/open-access-marc/umich_created_20151120.marc.gz

TODO

  • [ ] Add simple cli
  • [ ] Support different encodings (e.g. latin-1)
  • [ ] Support marc8 encoding
  • [ ] Support XML serialization
  • [ ] Support JSON serialization
  • [ ] Support (sub-)field access like marc-x