Swiftpack.co - Package - gservera/TaxonomyKit

TaxonomyKit

TaxonomyKit

Platforms GitHub release Build Status GitHub license SwiftPM compatible Swift version codebeat badge

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.

How To Get Started

  • 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.

First steps

🔭 Get the NCBI's Taxonomy ID for the taxon you're looking for

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)")
    }
}

⬇️ Download your taxa

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)")
    }
}

📖 Get an extract from Wikipedia

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)")
    }
}

Requirements

  • macOS 10.14 Mojave or greater.
  • Xcode 11 or greater.

Unit Tests

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.

☕️ Author

Proudly developed by Guillem Servera Negre in Palma, Illes Balears.

License

TaxonomyKit is released under the MIT license. See LICENSE for details.

Github

link
Stars: 2
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

2.1 - Oct 10, 2019

  • Support for Swift Package Manager
  • Support for Swift 5.1

2.0 - May 2, 2019

  • Support for Swift 5.
  • Awaits connectivity supported Apple platforms.

1.9 - Oct 30, 2018

  • Support for fetching child taxa
  • Support for multiple-taxa downloads
  • Better Wikipedia HTML parsing

1.6 - Nov 15, 2017

  • Built in XML parser.
  • Minor fixes.

1.5.1 - Oct 12, 2017

  • Made ExternalLink public