Skip to content
module

marinvaders.api_calls

Requests to the web services APIs of OBIS and WORMS

OBIS: https://api.obis.org/ WoRMS: http://marinespecies.org/rest/

Functions
  • obis_taxon(aphia_ids) (DataFrame) Get extra fields from OBIS API using different url</>
  • request_obis(eco_code, aphia_id) (pandas.DataFrame) Query OBIS API either by marine ecoregion code or aphia_id. WhenTimeout error occurs the request is repeated 5 times.</>
  • request_worms(aphia_ids) (pandas DataFrame) Request call to WoRMS API web service</>
function

marinvaders.api_calls.request_obis(eco_code=None, aphia_id=None)

Query OBIS API either by marine ecoregion code or aphia_id. WhenTimeout error occurs the request is repeated 5 times.

Parameters
  • eco_code (int) Marine eco region code
  • aphia_id (int) Species Aphia ID based on WoRMS
Returns (pandas.DataFrame)

Obis data

Raises
  • NotImplementedError If both eco_code and AphiaID is used
  • RuntimeError Anything get wrong during using OBIS API calls
  • ValueError Neither eco_code or AphiaID is used
function

marinvaders.api_calls.obis_taxon(aphia_ids) → DataFrame

Get extra fields from OBIS API using different url

function

marinvaders.api_calls.request_worms(aphia_ids)

Request call to WoRMS API web service

NOTE: Exception are logged to log file - marine_invaders.log and passed

Parameters
  • aphia_ids (list of int) aphia IDs of species
Returns (pandas DataFrame)

Worms data