Salad
TaxonWorks Labs Product
salad is a meta-gem that bundles the SpeciesFileGroup Ruby API wrappers into a single package and ships a salad executable that drops you into a Pry console with every service pre-loaded. It's a one-stop REPL for exploring biodiversity informatics APIs without bouncing between repos or firing up the full TaxonWorks Rails app.
Installation
Add this line to your application's Gemfile:
gem 'salad'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install salad
Usage
Launch the console from your terminal:
$ salad
salad v0.0.1 — type `help` to list services, `hints` for tips.
salad>
List every bundled service and the two ways to access it:
help Salad
=== Salad Services ===
Access bundled biodiversity informatics API wrappers by service name or gem name:
Salad.bels Salad.bell_pepper -> BellPepper
Salad.bhlnames Salad.bok_choy -> BokChoy
Salad.bionomia Salad.bananomia -> Bananomia
Salad.catalogue_of_life Salad.colrapi -> Colrapi
Salad.checklistbank Salad.colrapi -> Colrapi
Salad.clb Salad.colrapi -> Colrapi
Salad.col Salad.colrapi -> Colrapi
Salad.gnverifier Salad.checkerberry -> Checkerberry
Salad.inaturalist Salad.nasturtium -> Nasturtium
Salad.openalex Salad.syconium -> Syconium
Salad.owl Salad.hookkaido -> Hookkaido
Salad.plazi Salad.plazucchini -> Plazucchini
Salad.wikidata Salad.wikimelon -> Wikimelon
Salad.worms Salad.crawlyflower -> Crawlyflower
Each wrapper is also available under its own top-level constant, so anything you'd do in an individual gem's console works here too:
Crawlyflower.record(127160)
Nasturtium::Observation.find(42)
BellPepper.georeference("University of Illinois, Urbana, IL")
Accessing services
Three equivalent styles are supported — pick whichever you find most readable:
Salad.inaturalist # service name
Salad.nasturtium # gem name (keeps the produce pun alive)
Nasturtium # raw top-level constant
All three return the same module.
Using salad as a library
You can also require 'salad' from your own code to load all wrappers at once:
require 'salad'
Salad.worms.record(127160)
Salad.openalex.works(filter: { "authorships.author.id" => "A5023888391" })
Included gems
| Service | Gem | API |
|---|---|---|
Salad.bels |
bell_pepper |
BELS Georeference |
Salad.bhlnames |
bok_choy |
BHLnames |
Salad.bionomia |
bananomia |
Bionomia |
Salad.col |
colrapi |
Catalogue of Life / ChecklistBank |
Salad.gnverifier |
checkerberry |
GNverifier |
Salad.inaturalist |
nasturtium |
iNaturalist |
Salad.openalex |
syconium |
OpenAlex |
Salad.owl |
hookkaido |
Ontology Lookup Service (OLS) |
Salad.plazi |
plazucchini |
Plazi TreatmentBank |
Salad.wikidata |
wikimelon |
Wikidata |
Salad.worms |
crawlyflower |
WoRMS |
Because salad installs each wrapper as a normal runtime dependency, you can freely mix it into a project that already depends on individual wrappers — Bundler will resolve them to compatible versions.
Development
After checking out the repo, run bundle install to install dependencies. Run bin/console for an interactive prompt that will allow you to experiment (this is the same console shipped by the salad executable, but it uses your local working copy of the gem).
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in lib/salad/version.rb, update the CHANGELOG.md, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.
License
The gem is available as open source under the terms of the MIT license. You can learn more about the MIT license on Wikipedia and compare it with other open source licenses at the Open Source Initiative.
Third-party licensing and attribution details for vendored code are listed in THIRD_PARTY_NOTICES.md.
Code of Conduct
Everyone interacting in the Salad project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.