Python client for the OBIS API.
Source on GitHub at iobis/pyobis
Pyobis is an interesting python package that helps users fetch data from OBIS API which holds a great amount of ocean open-data, with ease.
The Ocean Biodiversity Information System (OBIS) <https://obis.org>, a global open-access data and information clearing-house on marine biodiversity for science, conservation, and sustainable development, maintained by IOOS, harvests occurrence records from thousands of datasets and makes them available as a single integrated dataset via various services including the OBIS API.
Other OBIS clients:
- R: robis, iobis/robis
Here are just a few of things pyOBIS can do: - Easy handling of OBIS data, easy fetching without handling the raw API response directly. - Built-in functions for occurrence, taxon, node, checklist and dataset endpoints of OBIS API. - Provides easy export of data to Pandas DataFrame, and helps researchers focus more on analysis rather than data mining.
For examples of how to use this repo, see the jupyter notebooks in the /notebooks/ directory. NOTE: GitHub's jupyter notebook display does not show interactive plots; open the notebooks in a jupyter hub (eg colab, binder, etc) for the full experience.
Install from pypi
pip install pyobis
Install latest dev version from github
pip install git+git://github.com/sckott/pyobis.git#egg=pyobis
Install editable dev version from github for local development. System prerequisites: python3, conda
# fetch code
git clone [email protected]:iobis/pyobis.git
cd pyobis
# install
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
python -m pip install -e .
# test your installation
python -m pytest
# test and generate a coverage report
python -m pytest -rxs --cov=pyobis tests
The official documentation is hosted at readthedocs.io https://pyobis.readthedocs.io/en/latest/ <https://pyobis.readthedocs.io/en/latest/>
pyobis is split up into modules for each of the groups of API methods.
- taxa - Taxonomic names
- occurrences - Occurrence search
- dataset - Dataset
- nodes - Nodes
- checklist - Checklist
You can import the entire library, or each module individually as needed.
from pyobis import taxa
taxa.search(scientificname = 'Mola mola')
taxa.search(scientificname = 'Mola mola', offset=10, limit=10)
taxa.search(geometry='POLYGON((30.1 10.1, 10 20, 20 40, 40 40, 30.1 10.1))', limit=20)
taxa.search(aphiaid=key, year="2013", limit=20)
taxa.taxon(406296)
taxa.taxon(415282)
Search
from pyobis import occurrences
occurrences.search(scientificname = 'Mola mola')
occurrences.search(scientificname = 'Mola mola', offset=0, limit=10)
occurrences.search(geometry='POLYGON((30.1 10.1, 10 20, 20 40, 40 40, 30.1 10.1))', limit=20)
occurrences.search(aphiaid=key, year="2013", limit=20)
Download
res = occ.download(year = 2001, scientificname = 'Orcinus')
res.uuid
res.status()
res.fetch()
from pyobis import dataset
dataset.search(scientificname = ['Mola', 'Abra', 'Lanice', 'Pectinaria'])
dataset.get(id = 'ec9df3b9-3b2b-4d83-881b-27bcbcd57b95')
from pyobis import nodes
nodes.search(scientificname = ['Mola', 'Abra'] )
from pyobis import checklist as ch
ch.list(year = 2005, scientificname = 'Cetacea')
- License: MIT, see LICENSE file
- 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.