Skip to main content

WMO WIS Catalogue Python client

Project description

pywiscat

Build Status

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

PEP8

Issues

Issues are managed at https://github.com/wmo-im/pywiscat/issues

Contact

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pywiscat-0.4.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pywiscat-0.4.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file pywiscat-0.4.0.tar.gz.

File metadata

  • Download URL: pywiscat-0.4.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for pywiscat-0.4.0.tar.gz
Algorithm Hash digest
SHA256 bb51900c5da2b2273aa7112bc58313010c29e4e35b15ffa8a99c2e382a65a4da
MD5 db6df39f71268b9068b4d2e4b6a66c2e
BLAKE2b-256 f6fe6295f27f240f70813249fef739fac13c3c85d5c7574d0f7931c216583645

See more details on using hashes here.

File details

Details for the file pywiscat-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: pywiscat-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for pywiscat-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67910bca73c8c51dfa9c2fa1c470abaeb9021e4bf134723c3420074ad8d3fd0c
MD5 06d2024873304f75049852862d093323
BLAKE2b-256 f1ff7bf423012245f1c51976036f2e04821f170f6916d2ee31196ed03a7a6985

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page