pycax 1.0.4.dev9+g5a44ded
pycax is a Python client for the Coordinated Assessments data exchange REST API. Coordinated Assessments data eXchange (CAX) is developed by the Coordinated Assessments Partnership (CAP). CAP is a collaborative process to efficiently share and provide access to standardized derived information, such as fish population-scale high-level indicators (HLIs) and supporting metrics. Participants in CAP include state fish and wildlife management agencies, tribes, federal agencies such as National Oceanic and Atmospheric Administration Fisheries (NOAA Fisheries) and Bonneville Power Administration (BPA), and others. CAP is co-sponsored by StreamNet and Pacific Northwest Aquatic Monitoring Partnership (PNAMP). Make sure to review the StreamNet Terms of Use for these data, the StreamNet Data Policy and the citation information from StreamNet and PNAMP for database queries. pycax authors: Eli Holmes and Mari Williams, Northwest Fisheries Science Center, NOAA Fisheries.
Other CAX clients: rCAX a R client, nwfsc-math-bio/rCAX
Installation
from pypi
pip install pycax-client
dev version
pip install git+git://github.com/nwfsc-math-bio/pycax.git#egg=pycax-client
Examples
user_guide Jupyter notebook
Library API
pycax
is split up into these modules
datasets
- The tables available for download with metadata.tables
- Download an individual table given its name (as in the datasets table)hli
- Download a HLI table in either “XPort” (default) or base format. “XPort” is the same as the CAP Tabular Query.
For accessing the HLI tables, you only need to import the hli module. A maximum of 1000 rows of data are downloaded (by default). Typically you will want to filter the query by passing in fargs as dictionary with the column name values. For example, {‘popid’: 7} would return popid equal to 7 only.
Examples of functions returning the data as a pandas data frame are shown.
HLI module
from pycax import hli
res = hli.getdf("NOSA", tabletype="xport", fargs={'popid': 7})
res.head()
Tables module
from pycax import tables
res = tables.getdf("EscData", fargs={'popid': 7})
res.head()
Datasets module
from pycax import datasets
res = datasets.getdf()
res['name', 'id'].head()
Meta
License: MIT
Contents
License
MIT + addendum