resources module

resources.search(scientificname=None, aphiaid=None, obisid=None, startdate=None, enddate=None, startdepth=None, enddepth=None, geometry=None, year=None, limit=500, offset=0, **kwargs)

Search OBIS resources

Parameters:
  • aphiaid – [Fixnum] A obis occurrence identifier
  • scientificname – [String,Array] One or more scientific names from the OBIS backbone. All included and synonym taxa are included in the search.
  • year – [Fixnum] The 4 digit year. A year of 98 will be interpreted as AD 98. Supports range queries, smaller,larger (e.g., ‘1990,1991’, whereas ‘1991,1990’ wouldn’t work)
  • geometry – [String] Well Known Text (WKT). A WKT shape written as either POINT, LINESTRING, LINEARRING or POLYGON. Example of a polygon: ((30.1 10.1, 20, 20 40, 40 40, 30.1 10.1)) would be queried as http://bit.ly/1BzNwDq
  • obisid – [Fixnum] An OBIS id. This is listed as the id or valid_id in taxa/taxon results
  • aphiaid – [Fixnum] An Aphia id. This is listed as the worms_id in taxa/taxon results
  • startdate – [Fixnum] Start date
  • enddate – [Boolean] End date
  • startdepth – [Fixnum] Start depth
  • enddepth – [Boolean] End depth
  • limit – [Fixnum] Number of results to return. Default: 1000
  • offset – [Fixnum] Start at record. Default: 0
Returns:

A dictionary

Usage:

from pyobis import resources
resources.search(scientificname = 'Mola mola')

# Many names
resources.search(scientificname = ['Mola', 'Abra', 'Lanice', 'Pectinaria'])

# Use paging parameters (limit and start) to page. Note the different results
# for the two queries below.
resources.search(scientificname = 'Mola mola', offset=0, limit=3)
resources.search(scientificname = 'Mola mola', offset=10, limit=2)

# Search on a bounding box
## in well known text format
resources.search(geometry='POLYGON((30.1 10.1, 10 20, 20 40, 40 40, 30.1 10.1))', limit=20)
from pyobis import taxa
res = taxa.search(scientificname='Mola mola')['results'][0]
resources.search(obisid=res['id'], geometry='POLYGON((30.1 10.1, 10 20, 20 40, 40 40, 30.1 10.1))', limit=20)
resources.search(aphiaid=res['worms_id'], geometry='POLYGON((30.1 10.1, 10 20, 20 40, 40 40, 30.1 10.1))', limit=20)

# Get resources for a particular eventDate
resources.search(aphiaid=res['worms_id'], year="2013", limit=20)
resources.resource(id, **kwargs)

Get resource by ID

Parameters:id – [Fixnum] An OBIS resource identifier
Returns:A dictionary

Usage:

from pyobis import resources
resources.resource(103)
resources.resource(2126)
resources.citation(scientificname=None, aphiaid=None, obisid=None, startdate=None, enddate=None, startdepth=None, enddepth=None, geometry=None, year=None, limit=500, offset=0, **kwargs)

List dataset citations

Parameters:
  • aphiaid – [Fixnum] A obis occurrence identifier
  • scientificname – [String,Array] One or more scientific names from the OBIS backbone. All included and synonym taxa are included in the search.
  • year – [Fixnum] The 4 digit year. A year of 98 will be interpreted as AD 98. Supports range queries, smaller,larger (e.g., ‘1990,1991’, whereas ‘1991,1990’ wouldn’t work)
  • geometry – [String] Well Known Text (WKT). A WKT shape written as either POINT, LINESTRING, LINEARRING or POLYGON. Example of a polygon: ((30.1 10.1, 20, 20 40, 40 40, 30.1 10.1)) would be queried as http://bit.ly/1BzNwDq
  • obisid – [Fixnum] An OBIS id. This is listed as the id or valid_id in taxa/taxon results
  • aphiaid – [Fixnum] An Aphia id. This is listed as the worms_id in taxa/taxon results
  • startdate – [Fixnum] Start date
  • enddate – [Boolean] End date
  • startdepth – [Fixnum] Start depth
  • enddepth – [Boolean] End depth
  • limit – [Fixnum] Number of results to return. Default: 1000
  • offset – [Fixnum] Start at record. Default: 0
Returns:

A dictionary

Usage:

from pyobis import resources
resources.citation(scientificname = 'Mola mola')

# Many names
resources.citation(scientificname = ['Mola', 'Abra', 'Lanice', 'Pectinaria'])

# Use paging parameters (limit and start) to page. Note the different results
# for the two queries below.
resources.citation(scientificname = 'Mola mola', offset=0, limit=10)
resources.citation(scientificname = 'Mola mola', offset=10, limit=10)