pywmocat
Pythonic API to WIS2 Global Discovery Catalogue / WIGOS Global Observing Facility Catalogue
pywmocat provides a Pythonic API atop the WIS2 Global Discovery Catalogue (GDC) and the WIGOS Global Observing Catalogue (GOFC).
Installation
pip
Install latest stable version from PyPI.
pip3 install pywmocat
From source
Install latest development version.
python3 -m venv pywmocat
cd pywmocat
. bin/activate
git clone https://github.com/wmo-im/pywmocat.git
cd pywmocat
pip3 install .
Running
WIS2 GDC workflows
The default WIS2 GDC used in pywmocat is https://wis2-gdc.weather.gc.ca/collections/wis2-discovery-metadata.
To use a different WIS2 GDC, set the PYWMOCAT_WIS2_GDC_URL environment variable before running pywmocat.
# fetch version
pywmocat --version
# search the WIS2 Global Discovery Catalogue (GDC)
pywmocat wis2-gdc search
# search the WIS2 Global Discovery Catalogue (GDC) with a full text query
pywmocat wis2-gdc search --query radar
# search the WIS2 Global Discovery Catalogue (GDC) for only recommended data
pywmocat wis2-gdc search --data-policy recommended
# search the WIS2 Global Discovery Catalogue (GDC) by country
pywmocat wis2-gdc search --country Germany
# search the WIS2 Global Discovery Catalogue (GDC) with a bounding box query
pywmocat wis2-gdc search --bbox -142,42,-52,84
# get more information about a WIS2 GDC record
pywmocat wis2-gdc get urn:wmo:md:ca-eccc-msc:6d483864-0ec9-4cd6-8cf8-453e14fc9213
### Archive utilities
# download and extract a WIS2 GDC metadata archive zipfile to a specific directory
# downloads from PYWMOCAT_WIS2_GDC_URL by default
# override with --global-discovery-catalogue (https://example.org/collections/wis2-discovery-metadata)
pywmocat wis2-gdc 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
# pywmocat archive get /path/to/archive (directory MUST be identical)
pywmocat wis2-gdc archive compare /path/archive --centre-id ca-eccc-msc-global-discovery-catalogue
### Metrics analyzers
# analyze core records by centre identifier
pywmocat wis2-gdc metrics core /path/to/archive
# analyze recommended records by centre identifier
pywmocat wis2-gdc metrics recommended /path/to/archive
# analyze Earth system disciplines by centre identifier
pywmocat wis2-gdc metrics earth-system-discipline /path/to/archive
# analyze Key Performance Indicators (KPIs) by centre identifier
pywmocat wis2-gdc metrics kpi ca-eccc-msc /path/to/archive
Using the API
from pywmocat.wis2_gdc.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')
WIGOS GOFC workflows
The default WIS2 GDC used in pywmocat is TODO: add default GOFC endpoint.
To use a different WIGOS GOFC, set the PYWMOCAT_WIGOS_GOFC_URL environment variable before running pywmocat.
From command line:
# search the WIGOS Global Observing Catalogue (GOFC)
pywmocat wigos-gofc search
# search the WIGOS Global Observing Catalogue (GOFC) with a full text query
pywmocat wigos-gofc search --query temperature
# search the WIGOS Global Observing Catalogue (GOFC) with a bounding box query
pywmocat wigos-gofc search --bbox -142,42,-52,84
# get more information about a WMDR record
pywmocat wigos-gofc get 0-20000-0-87344
### Archive utilities
# download and extract a WIGOS GOFC metadata archive zipfile to a specific directory
# downloads from PYWMOCAT_WIGOS_GOFC_URL by default
# override with --global-discovery-catalogue (https://example.org/collections/wigos-observing-facility-metadata)
pywmocat wigos-gofc archive get /path/to/archive
Using the API
from pywmocat.wigos_gofc.catalogue import search, get
# search catalogue
results = search(q='temperature', bbox=[-142, 42, -52, 84]))
# get a single catalogue record
results = get('0-20000-0-87344')
Development
python3 -m venv pywmocat
cd pywmocat
source bin/activate
git clone https://github.com/wmo-im/pywmocat.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/pywmocat/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/pywmocat/issues
Contact
Metadata
Release files for pywmocat 0.5.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 | |
|---|---|---|---|
| pywmocat-0.5.0.tar.gz | 13.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pywmocat-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.5 kB
Release files / pywmocat-0.5.0.tar.gz
| Download URL | pywmocat-0.5.0.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
04e36c0937dc63fc47c42b953a2dbf9d4711c405499f90a99e68770642e298a2
|
|
BLAKE2b-256 checksum How to use checksums |
a7c6fcb45c84cd348d1638e28cba5b6bb462baa1c2419f98399b8e9811701cd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / pywmocat-0.5.0-py3-none-any.whl
| Download URL | pywmocat-0.5.0-py3-none-any.whl |
|---|---|
| Size | 23.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9837c77beaa1ac03e3ab8036244d37f3d0d61c95cfa503e4a95337a7d12a0e60
|
|
BLAKE2b-256 checksum How to use checksums |
b89936c56f70b966ac2ec4ef38287647cf6e2ebd8b9d0a14c28009f593af3dc3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|