TaxonomyKit is a powerful, handy and cross-platform library that makes working with taxonomy data from the NCBI databases easier. It works as a client of the NCBI's Entrez Programming Utilities and it is the core of the Taxonomist app.
- Download TaxonomyKit or fecth it using Swift Package Manager.
- Check out the Documentation for the Taxonomy struct or just read the following section to begin quickly.
let myCoolQuery = "quercus ilex"
Taxonomy.findIdentifiers(for: myCoolQuery) { result in
switch result {
case .success(let foundIDs):
print("Found identifiers: \(foundIDs).")
case .failure(let error):
print("Oops! Something went wrong. Error was: \(error)")
}
}
let foundIDs: [TaxonID] = [58334] // Use the one you got from previous step.
Taxonomy.downloadTaxa(identifiers: [foundIDs]) { result in
switch result {
case .success(let taxa):
print("Got \(taxa.count) taxa.")
case .failure(let error):
print("Oops! Something went wrong. Error was: \(error)")
}
}
Wikipedia.retrieveAbstract(for: downloadedTaxon) { result in
switch result {
case .success(let wikipediaResult):
print("Got info: \(wikipediaResult.extract).")
case .failure(let error):
print("Oops! Something went wrong. Error was: \(error)")
}
}
- macOS 10.14 Mojave or greater.
- Xcode 11 or greater.
TaxonomyKit includes a suite of unit tests within the Tests subdirectory. These tests can be run simply be executed the test action on the platform framework you would like to test.
Proudly developed by Guillem Servera Negre in Palma, Illes Balears.
TaxonomyKit is released under the MIT license. See LICENSE for details.