Giter Site home page Giter Site logo

gbifrb's Introduction

gbifrb

gem version Ruby codecov.io

gbifrb is a low level client for the GBIF API

Other GBIF API clients:

Changes

For changes see the Changelog

API

Methods in relation to GBIF API routes

registry

  • /node - Gbif::Registry.nodes
  • /network - Gbif::Registry.networks
  • /installations - Gbif::Registry.installations
  • /organizations - Gbif::Registry.organizations
  • /dataset_metrics - Gbif::Registry.dataset_metrics
  • /datasets - Gbif::Registry.datasets
  • /dataset_suggest - Gbif::Registry.dataset_suggest
  • /dataset_search - Gbif::Registry.dataset_search

species

  • /species/match - Gbif::Species.name_backbone
  • /species/suggest - Gbif::Species.name_suggest
  • /species/search - Gbif::Species.name_lookup
  • /species - Gbif::Species.name_usage

occurrences

  • /search - Gbif::Occurrences.search
  • /get - Gbif::Occurrences.get
  • /get_verbatim - Gbif::Occurrences.get_verbatim
  • /get_fragment - Gbif::Occurrences.get_fragment

Install

Release version

gem install gbifrb

Development version

git clone [email protected]:sckott/gbifrb.git
cd gbifrb
rake install

Examples, in Ruby repl

Registry module

Nodes

require 'gbifrb'
registry = Gbif::Registry
registry.nodes(limit: 5)

Networks

registry.networks(uuid: '16ab5405-6c94-4189-ac71-16ca3b753df7')

Species module

GBIF backbone

species = Gbif::Species
species.name_backbone(name: "Helianthus")

Suggester

species.name_suggest(q: "Helianthus")

Lookup

species.name_lookup(q: "Helianthus")

Lookup example with more parameters: name usages of plants where accepted scientific name includes 'reptans':

species.name_lookup(q: 'reptans', higherTaxonKey: 6, nameType: 'SCIENTIFIC', status: 'ACCEPTED')

Name usage (/species)

species.name_usage(name: "Helianthus")

Name usage example with more parameters: name usages of 'Andropogon' in Database of Vascular Plants of Canada (VASCAN) checklist:

species.name_usage(name: 'Andropogon', datasetKey: '3f8a1297-3259-4700-91fc-acc4170b27ce')

Occurrences

occ = Gbif::Occurrences
occ.search(taxonKey: 3329049)
occ.search(taxonKey: 3329049, limit: 2)
occ.search(scientificName: 'Ursus americanus')

curl options

species = Gbif::Species
species.name_backbone("Helianthus", verbose: true)

Todo

  • CLI interface
  • occurrence metrics methods
  • occurrence downloads methods
  • OAI-PMH interface

Meta

  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
  • License: MIT

gbifrb's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar kspurgin avatar sckott avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mjy kspurgin

gbifrb's Issues

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Bundler::VersionConflict with message: Bundler found conflicting requirements for the Ruby version:
  In Gemfile:
    Ruby (~> 2.0.0.0)

    faraday (~> 1.1) was resolved to 1.4.1, which depends on
      Ruby (>= 2.4)

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Bundler::VersionConflict with message: Bundler found conflicting requirements for the Ruby version:
  In Gemfile:
    Ruby (~> 2.0.0.0)

    faraday (~> 1.1) was resolved to 1.4.0, which depends on
      Ruby (>= 2.4)

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Support for /grscicoll/collection

As a developer I want a wrapper for the collections endpoint. API

Params:

  • q
  • institution
  • contact
  • code
  • name

Personal priorities:

  • /grscicoll/collection
  • /grscicoll/collection/suggest
  • /grscicoll/collection/{UUID}/identifier
  • /grscicoll/collection/deleted
  • /grscicoll/collection/{UUID}/tag

Species `name_usage` params include unsupported parameters

The following params on the Species name_usage method are not supported and do not work:

  • key
  • data
  • uuid
  • rank
  • shortname

These parameters are not listed for this search method on https://www.gbif.org/developer/species

Details on each below, and a PR forthcoming.

key

I cannot seem to find any key that has any effect when passed in here. The result set always begins with taxonID=>gbif:0 and seems to include everything.

data
I saved the results for:

https://api.gbif.org/v1/species?name=Puma%20concolor

and

https://api.gbif.org/v1/species?name=Puma%20concolor&data=all

The files were identical when diffed.

uuid

The comments in the code say this should work the same as datasetKey

test = species.name_usage(name: 'Andropogon', datasetKey: '3f8a1297-3259-4700-91fc-acc4170b27ce')
test['results'].length
=> 2
test['results'].each{ |r| puts r['key'] }
100015804
100015805

But it does not:

test = species.name_usage(name: 'Andropogon', uuid: '3f8a1297-3259-4700-91fc-acc4170b27ce')
test['results'].length
=> 89
test['results'].first['key']
=> 2706077
test['results'].last['key']
=> 181589405

It has no effect, and produces the same results as passing only the name parameter:

test = species.name_usage(name: 'Andropogon')
test['results'].length
=> 89
test['results'].first['key']
=> 2706077
test['results'].last['key']
=> 181589405

rank

Does not seem to have any effect:

test = species.name_usage(name: 'Helianthus', rank: 'SPECIES')
test['results'].map{ |t| t['rank'] }.tally
=> {"GENUS"=>64, nil=>2, "SPECIES"=>2}

test = species.name_usage(name: 'Helianthus')
test['results'].length
=> 68

shortname

The comments in the code say: A short name..need more info on this?

I'm not seeing it documented in the Species API at all. It's referenced in terms of the /species/root/{uuid|shortname} route, but that is not the root being used by this name_usage method.

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Bundler::VersionConflict with message: Bundler found conflicting requirements for the Ruby version:
  In Gemfile:
    Ruby (~> 2.0.0.0)

    rake (~> 13.0, >= 13.0.1) was resolved to 13.0.3, which depends on
      Ruby (>= 2.2)

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Bundler::VersionConflict with message: Bundler found conflicting requirements for the Ruby version:
  In Gemfile:
    Ruby (~> 2.0.0.0)

    faraday (~> 1.1) was resolved to 1.4.1, which depends on
      Ruby (>= 2.4)

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Bundler::VersionConflict with message: Bundler found conflicting requirements for the Ruby version:
  In Gemfile:
    Ruby (~> 2.0.0.0)

    faraday (~> 1.1) was resolved to 1.3.0, which depends on
      Ruby (>= 2.4)

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.