taxa module

class pyobis.taxa.TaxaResponse(url, args, cache=True)[source]

An OBIS Taxa Response Class

Usage

from pyobis import taxa

query = taxa.search(scientificname="Mola mola", cache=True)
query.execute()
query.data  # Returns the data
query.api_url  # Returns the API URL
query.to_pandas()  # Returns a pandas DataFrame

data = taxa.search(scientificname="Mola mola").execute()
taxa.search(geometry="POLYGON((30.1 10.1, 10 20, 20 40, 40 40, 30.1 10.1))")
taxa.taxon(10332)
taxa.taxon(127405)

Methods:

pyobis.taxa.search(scientificname=None, cache=True, **kwargs)[source]

Get taxon records.

Parameters:
  • scientificname – [String,Array] One or more scientific names from the OBIS backbone. All included and synonym taxa are included in the search

  • cache – [bool, optional] Whether to use caching. Defaults to True.

Returns:

A dictionary

Usage:

from pyobis import taxa

# With caching enabled (default)
query = taxa.search(scientificname='Mola mola')
query.execute()

# With caching disabled
query = taxa.search(scientificname='Mola mola', cache=False)
query.execute()

# Get the data
query.data # return the fetched data
query.api_url # get the OBIS API URL for the built query
query.mapper_url # get the OBIS Mapper URL (if it exists)
pyobis.taxa.taxon(id, cache=True, **kwargs)[source]

Get taxon by ID

Parameters:
  • id – [Fixnum] An OBIS taxon identifier

  • cache – [bool, optional] Whether to use caching. Defaults to True.

Returns:

A TaxaResponse object

Usage:

from pyobis import taxa

# With caching enabled (default)
query1 = taxa.taxon(545439)
query1.execute()

# With caching disabled
query1 = taxa.taxon(545439, cache=False)
query1.execute()
pyobis.taxa.annotations(scientificname, cache=True, **kwargs)[source]

Get scientific name annotations by the WoRMS team.

Parameters:
  • scientificname – [String] Scientific name. Leave empty to include all taxa.

  • cache – [bool, optional] Whether to use caching. Defaults to True.

Returns:

A TaxaResponse Object

Usage:

from pyobis import taxa

# With caching enabled (default)
query1 = taxa.annotations(scientificname="Abra")
query1.execute()

# With caching disabled
query1 = taxa.annotations(scientificname="Abra", cache=False)
query1.execute()