Thredds client is available as Anaconda package. Install it with the following command:
conda install -c conda-forge threddsclient
Thredds Client is available from PyPI to install directly with pip
or poetry
.
pip install threddsclient
poetry add threddsclient
Check out code from the birdy GitHub repo and start the installation:
git clone https://github.com/bird-house/threddsclient.git
cd threddsclient
conda env create -f environment.yml
source activate threddsclient
python setup.py develop
Alternatively, you can also install it directly with pip
using a virtual environment of your choice:
pip install "threddsclient @ git+https://github.com/bird-house/threddsclient.git"
Read the Thredds tutorial on catalogs: Thredds Catalog Primer
import threddsclient
urls = threddsclient.download_urls('http://example.com/thredds/catalog.xml')
import threddsclient
urls = threddsclient.opendap_urls('http://example.com/thredds/catalog.xml')
Start reading a catalog
import threddsclient
cat = threddsclient.read_url('http://example.com/thredds/catalog.xml')
Get a list of references to other catalogs & follow them
refs = cat.references
print refs[0].name
cat2 = refs[0].follow()
Get a list of datasets in this catalog
data = cat.datasets
Get flat list of all direct datasets (data files) in the catalog
datasets = cat.flat_datasets()
Get flat list of all references in the catalog
references = cat.flat_references()
Crawl recursive all direct datasets in catalog following the catalog references. Stop recursion at a given depth level.
import threddsclient
for ds in threddsclient.crawl('http://example.com/thredds/catalog.xml', depth=2):
print ds.name
Check out code from the birdy GitHub repo and start the installation:
git clone https://github.com/bird-house/threddsclient.git
cd threddsclient
conda env create -f environment.yml
python setup.py develop
Install additional dependencies:
conda install pytest flake8 sphinx bumpversion
# OR
pip install -r requirements_dev.txt
Make a new version of Birdy in the following steps:
- Make sure everything is commit to GitHub.
- Update
CHANGES.rst
with the next version. - Dry Run:
bumpversion --dry-run --verbose --new-version 0.3.4 patch
- Do it:
bumpversion --new-version 0.3.4 patch
- ... or:
bumpversion --new-version 0.4.0 minor
- Push it:
git push --tags
See the bumpversion documentation for details.