pyobistools.taxa

Module Contents

Functions

_standardize_types(df)

remove_suffix(name)

add_suffix(name)

Adds suffixes to a name for searching ITIS

match_taxa(names[, ask, itis_usage])

Wrap the existing functionality in validation in the expected name for this function as per R's iobis/obistools.

search_worms(names[, kwargs])

Searches WoRMS for records based on a list of scientific names and returns

search_itis(names[, kwargs])

Searches ITIS for records based on a list of scientific names and returns

search_obis(names[, kwargs])

Searches OBIS for records based on a list of scientific names and returns

search(names[, worms_kwargs, itis_kwargs, ...])

Search a list of scientific names in WoRMS, ITIS and OBIS and return the resulting

Attributes

STANDARD_SPECIES_COLUMNS

pyobistools.taxa.STANDARD_SPECIES_COLUMNS[source]
pyobistools.taxa._standardize_types(df)[source]
Parameters:

df (pandas.DataFrame) –

Return type:

pandas.DataFrame

pyobistools.taxa.remove_suffix(name)[source]
Parameters:

name (str) –

Return type:

str

pyobistools.taxa.add_suffix(name)[source]

Adds suffixes to a name for searching ITIS

Parameters:

name (str) –

Return type:

List[str]

pyobistools.taxa.match_taxa(names, ask=True, itis_usage=False)[source]

Wrap the existing functionality in validation in the expected name for this function as per R’s iobis/obistools.

@param names List of scientific names to check against @param ask Do we ask the user to resolve multi-match or ambiguous names? @param itis_usage Pass through the ITIS check setting for the client function to handle

@return structure with appended lsids where WoRMS (or ITIS can resolve them)

pyobistools.taxa.search_worms(names, kwargs={})[source]

Searches WoRMS for records based on a list of scientific names and returns a standardized pandas DataFrame representing the results

Parameters:
  • names (t.List[str]) – List of scientific names to match

  • kwargs (Dict[str, Any]) –

Returns:

Species records

Return type:

pd.DataFrame

pyobistools.taxa.search_itis(names, kwargs={})[source]

Searches ITIS for records based on a list of scientific names and returns a standardized pandas DataFrame representing the results

Parameters:
  • names (t.List[str]) – List of scientific names to match

  • kwargs (Dict[str, Any]) –

Returns:

Species records

Return type:

pd.DataFrame

pyobistools.taxa.search_obis(names, kwargs={})[source]

Searches OBIS for records based on a list of scientific names and returns a standardized pandas DataFrame representing the results

Parameters:
  • names (t.List[str]) – List of scientific names to match

  • kwargs (Dict[str, Any]) –

Returns:

Species records

Return type:

pd.DataFrame

pyobistools.taxa.search(names, worms_kwargs={}, itis_kwargs={}, obis_kwargs={}, order=None, quick=False)[source]

Search a list of scientific names in WoRMS, ITIS and OBIS and return the resulting record information in a DataFrame. Tries WoRMS first, ITIS second, and OBIS third unless another order is specificed with the “order” parameter.

Parameters:
  • names (t.List[str]) – List of scientific names to match

  • worms_kwargs (t.Dict[str, t.Any]) – keyword arguments to pass to pyworm’s “aphiaRecordsByMatchNames” function

  • itis_kwargs (t.Dict[str, t.Any]) – keyword arguments to pass to ITIS

  • obis_kwargs (t.Dict[str, t.Any]) – keyword arguments to pass to OBIS

  • order (t.List[str]) – order which to to check external services, defaults to [‘worms’, ‘idis’, ‘obis’]. To only check a subset of sources set to a smaller list.

  • quick (bool) – Stop when the first match is found and return rather than query additional services

Returns:

Species records

Return type:

pd.DataFrame