Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Bibliotek

A Swift and Objective-C library for communicating with library databases using the Z39.50 protocol, powered by YAZ.

Usage Example

import Bibliotek

Connect to the Library of Congress's VOYAGER database.

let connection = try! Connection(host: "z3950.loc.gov", port: 7090, database: "VOYAGER")

Create a request to find books with some ISBN number.

let request = FetchRequest(keywords: ["9780385527880"], scope: .isbn)

Submit the request to a connection to receive results.

let records = try! connection.fetchRecords(request: request)

With a record, you can access information about the title, author, subject, and more.

extension FieldPath {
    static let isbn13 = FieldPath(tag: "020", code: "a")
    static let locCallNumber = FieldPath(tag: "050")
    static let dccNumber = FieldPath(tag: "082", code: "a")
    static let titleStatement = FieldPath(tag: "245")
}

record.content(with: .isbn13)
record.content(with: .locCallNumber)
record.content(with: .dccNumber)
record.content(with: .titleStatement)

Instructions

Clone the repository and all its submodules to your local machine.

    git clone --recurse-submodules https://github.com/stevebrun/Bibliotek.git

When you build the Bibliotek target for the first time, the ./configure script will be run to install prerequisite tools with Homebrew before proceeding to build YAZ into the project's build product's directory.

References

Z39.50 Endpoints

Official Specifications from the Library of Congress

OCLC Documents

Cataloger's Reference Shelf

YAZ Documentation from IndexData

Other Specifications

Other Sources

About

A Swift and Objective-C library for interacting with libraries using the Z39.50 protocol.

Resources

License

Packages

No packages published