pywiscat
Pythonic API to WMO WIS Catalogue
pywiscat provides a Pythonic API atop the WIS2 Global Discovery Catalogue (GDC).
Installation
pip
Install latest stable version from PyPI.
pip3 install pywiscat
From source
Install latest development version.
python3 -m venv pywiscat
cd pywiscat
. bin/activate
git clone https://github.com/wmo-im/pywiscat.git
cd pywiscat
pip3 install .
Running
The default GDC used in pywiscat is https://wis2-gdc.weather.gc.ca/collections/wis2-discovery-metadata.
To use a different catalogue, set the PYWISCAT_GDC_URL environment variable before running pywiscat.
From command line:
# fetch version
pywiscat --version
## WIS2 workflows
# search the WIS2 Global Discovery Catalogue (GDC)
pywiscat search
# search the WIS2 Global Discovery Catalogue (GDC) with a full text query
pywiscat search --query radar
# search the WIS2 Global Discovery Catalogue (GDC) for only recommended data
pywiscat search --data-policy recommended
# search the WIS2 Global Discovery Catalogue (GDC) by country
pywiscat search --country Germany
# search the WIS2 Global Discovery Catalogue (GDC) with a bounding box query
pywiscat search --bbox -142,42,-52,84
# get more information about a WIS2 GDC record
pywiscat get urn:x-wmo:md:can:eccc-msc:c7c9d726-c48a-49e3-98ab-78a1ab87cda8
## Archive utilities
# download and extract a WIS2 GDC metadata archive zipfile to a specific directory
# downloads from PYWISCAT_GDC_URL by default
# override with --global-discovery-catalogue (https://example.org/collections/wis2-discovery-metadata)
pywiscat archive get /path/to/archive
# compare GDC metadata archive zipfile to other GDC metadata archive zipfiles
# this requires each GDC metadata archive zipfile to be downloaded and extracted via
# pywiscat archive get /path/to/archive (directory MUST be identical)
pywiscat archive compare /path/archive --centre-id ca-eccc-msc-global-discovery-catalogue
## Metrics analyzers
# analyze core records by centre identifier
pywiscat metrics core /path/to/archive
# analyze recommended records by centre identifier
pywiscat metrics recommended /path/to/archive
# analyze Earth system disciplines by centre identifier
pywiscat metrics earth-system-discipline /path/to/archive
# analyze Key Performance Indicators (KPIs) by centre identifier
pywiscat metrics kpi ca-eccc-msc /path/to/archive
Using the API
## WIS2 workflows
from pywiscat.wis2.catalogue import search, get
# search catalogue
results = search(q='radar', bbox=[-142, 42, -52, 84]))
# get a single catalogue record
results = get('urn:x-wmo:md:can:eccc-msc:c7c9d726-c48a-49e3-98ab-78a1ab87cda8')
Development
python3 -m venv pywiscat
cd pywiscat
source bin/activate
git clone https://github.com/wmo-im/pywiscat.git
pip3 install .
Running tests
python3 tests/run_tests.py
Releasing
# create release (x.y.z is the release version)
vi pyproject.toml # update [project]/version
git commit -am 'update release version x.y.z'
git push origin master
git tag -a x.y.z -m 'tagging release version x.y.z'
git push --tags
# upload to PyPI
rm -fr build dist *.egg-info
python3 -m build
twine upload dist/*
# publish release on GitHub (https://github.com/wmo-im/pywiscat/releases/new)
# bump version back to dev
vi pyproject.toml # update [project]/version
git commit -am 'back to dev'
git push origin master
Code Conventions
Issues
Issues are managed at https://github.com/wmo-im/pywiscat/issues
Contact
Metadata
Release files for pywiscat 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pywiscat-0.4.0.tar.gz | 12.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pywiscat-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.3 kB
Release files / pywiscat-0.4.0.tar.gz
| Download URL | pywiscat-0.4.0.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb51900c5da2b2273aa7112bc58313010c29e4e35b15ffa8a99c2e382a65a4da
|
|
BLAKE2b-256 checksum How to use checksums |
f6fe6295f27f240f70813249fef739fac13c3c85d5c7574d0f7931c216583645
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / pywiscat-0.4.0-py3-none-any.whl
| Download URL | pywiscat-0.4.0-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
67910bca73c8c51dfa9c2fa1c470abaeb9021e4bf134723c3420074ad8d3fd0c
|
|
BLAKE2b-256 checksum How to use checksums |
f1ff7bf423012245f1c51976036f2e04821f170f6916d2ee31196ed03a7a6985
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|