A Swift and Objective-C library for communicating with library databases using the Z39.50 protocol, powered by YAZ.
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)
Clone the repository and all its submodules to your local machine.
git clone https://github.com/stevebrun/Bibliotek.git
Xcode will download and build the YAZ source code as needed when building the libyaz
target.
The Bibliotek
target depends on libyaz
, so this will happen automatically when building Bibliotek
.
- zbrary Directory of Z39.50 and SRU Targets
- Gateway to Library Catalogs
- Library of Congress Z39.50 Server Configuration Guidelines
- The bib-1 Attribute Set
- MARC 21 Format for Bibliographic Data
- MARCXML Schema
- Marc 21 Character Sets
- International Standard Bibliographic Description
- Z39.50 Protocol Specification
- Segmentation Marks in Dewey Numbers
- Bibliographic Formats and Standards
- Z39.50 Configuration Guide for OCLC Z39.50 Cataloging
- Library of Congress Call Number Format
- MARC in JSON Description
- JSON Schema for the MARC 21 Bibliographic Standard
- A proposal to serialize MARC in JSON
- Torroidal Code's isbn2.py
- kurtraschke's parsecallno.py
- Wikidata page on Library of Congress Classification
- 025.431: The Dewey Blog
- Documentation for the ZOOM Pearl extension
- Dewey Segmentation (the '/' in the dewey number)
- The ``Hello World'' Zoo
- A Comprehensive Approach to Algorithmic Machine Sorting of Library of Congress Call Numbers