Swiftpack.co - Package - jbuckner/InternetArchiveKit

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.

jbuckner/InternetArchiveKit

A Swift library to interact with the Internet Archive's API

Internet Archive Kit

Carthage compatible Build Status codecov

InternetArchiveKit is a Swift library to interact with the Internet Archive API

It was built to power Live Music Archive, an app I developed for listening to the Internet Archive's collection of live music.

General Information

The Internet Archive's structure is made up of Items and Files. Items are the top level "things", like audio, video, and books, that contain all of the metadata for the "thing". Items contain Files, which are the actual content of the Item. For instance, in a live music recording, the Item is a particular recording of a show with metadata about the show like artist, venue, taper, etc. The Files are the individual audio tracks from that show.

For more information about the Internet Archive's structure, see their Python Library Documentation.

Documentation

See the documenation for a full API reference

Basic Usage

import InternetArchiveKit

let query = InternetArchive.Query(
   clauses: ["collection": "etree", "mediatype": "collection"])
let archive = InternetArchive()

archive.search(
  query: query,
  page: 0,
  rows: 10,
  completion: { (response: InternetArchive.SearchResponse?, error: Error?) in
   let firstItem = response.response.docs.first
   // handle first item
})

archive.itemDetail(
  identifier: "sci2007-07-28.Schoeps",
  completion: { (item: InternetArchive.Item?, error: Error?) in
  let firstFile = item.files.first
  // handle first file
})

For more advanced usage, see the test suite and the included sample app.

Limitations

Currently, InternetArchiveKit is read-only and does not have support for all of Internet Archive's data. Pull requests are welcome!

Github

link
Stars: 2
Last commit: 2 days ago