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

Dependencies

Used By

Total: 0

Releases

2.1 - 2019-10-10 17:50:04

  • Support for Swift Package Manager
  • Support for Swift 5.1

2.0 - 2019-05-02 15:39:39

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

1.9 - 2018-10-30 17:44:56

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

1.6 - 2017-11-15 23:07:10

  • Built in XML parser.
  • Minor fixes.

1.5.1 - 2017-10-12 16:53:47

  • Made ExternalLink public

1.5 - 2017-09-29 12:48:21

  • Swift 4 support.
  • Support for lineage trees and lineage alignments.
  • New method for Wikipedia Page strict lookup based on a taxon's scientific name.
  • Moved Wikipedia methods into a new Wikipedia struct.
  • Improved tests, code quality and fixed some JSON-parsing errors.

1.4 - 2017-04-12 15:59:33

  • Thumbnail image download from Wikipedia.
  • Saving the Wikipedia article titles.
  • Made WikipediaLanguage initializer public.
  • Set deployment target to 10.10.

1.3 - 2017-02-27 18:57:08

  • Support for retrieving Wikipedia extracts.
  • Fixed some test cases that could unexpectedly fail due to the unintended use of the Mock URL session class.
  • Improved documentation and test coverage.

1.2.1 - 2016-11-23 17:59:57

  • Support for request cancellation.
  • Better test coverage

1.2 - 2016-11-19 22:59:50

  • Initial implementation of the TaxonTree struct to generate lineage trees from multiple taxons.
  • Refactored networking methods' callbacks to use a result wrapper (more Swifty!).
  • Modified Taxon and TaxonLineageItem to use TaxonomicRank values instead of strings.
  • Support for multiple common names in the Taxon struct.
  • Support synonyms and GenBank common name values in the Taxon struct.
  • Improved documentation.

1.1.1 - 2016-11-13 12:26:23

  • Fixed a bug in spelling suggestions when using uppercase queries

1.1 - 2016-11-08 11:03:04

  • Added support for the LinkOut service.
  • Improved stability.
  • Improved test coverage and documentation.

1.0 - 2016-11-04 16:57:08

Initial open source release

1.0 alpha 1 - 2016-10-16 09:26:37

Initial alpha release to work as a start point to test installation using Carthage.