An open API service indexing awesome lists of open source software.

https://github.com/miku/marc21

A MARC21 library for Go.
https://github.com/miku/marc21

code4lib marc

Last synced: 10 months ago
JSON representation

A MARC21 library for Go.

Awesome Lists containing this project

README

          

marc21
======

A Go [MARC21](https://www.loc.gov/marc/bibliographic/) implementation.

This repository started as a fork of
[gitorious.org/marc21-go/marc21](https://gitorious.org/marc21-go/marc21), but
is - as of June 2017 - the new home of the MARC21 Go library.

As of August 2019, we are working on a revised implementation, as there are some edge cases the current implementation cannot handle.

Usage
-----

```go
file, _ := os.Open("somedata.mrc")
record, _ := marc21.ReadRecord(file)
_ = record.WriteTo(os.Stdout)
```

More examples
-------------

A [simple example](https://github.com/miku/marc21/blob/master/examples/simple.go).

```go
package main

import (
"io"
"log"
"os"

"github.com/miku/marc21"
)

func main() {
for {
r, err := marc21.ReadRecord(os.Stdin)
if err == io.EOF {
break
}
if err != nil {
log.Fatal(err)
}
if _, err := r.WriteTo(os.Stdout); err != nil {
log.Fatal(err)
}
}
}
```

```xml
$ cat fixtures/sandburg.mrc | go run examples/simple.go | xmllint --format -


01142cam 2200301 a 4500
92005291
DLC
19930521155141.9
920219s1993 caua j 000 0 eng

92005291


0152038655 :
$15.95


DLC
DLC
DLC


lcac


PS3537.A618
A88 1993


811/.52
20


Sandburg, Carl,
1878-1967.


Arithmetic /
Carl Sandburg ; illustrated as an anamorphic adventure by Ted Rand.


1st ed.


San Diego :
Harcourt Brace Jovanovich,
c1993.


1 v. (unpaged) :
ill. (some col.) ;
26 cm.


One Mylar sheet included in pocket.


A poem about numbers and their characteristics ...


Arithmetic
Juvenile poetry.


Children's poetry, American.


Arithmetic
Poetry.


American poetry.


Visual perception.


Rand, Ted,
ill.

```