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 -r requirements.txt
pip3 install .

Running

The canonical URL for the GDC is https://wis2-gdc.weather.gc.ca.

To use a different catalogue, set the PYWISCAT_GDC_URL environmnent 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
pywiscat archive get /path/to/archive

## 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 -r requirements.txt
pip3 install -r requirements-dev.txt
python3 setup.py install

Running tests

python3 tests/run_tests.py

Releasing

# create release (x.y.z is the release version)
vi pywiscat/__init__.py  # update __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 setup.py sdist bdist_wheel --universal
twine upload dist/*

# publish release on GitHub (https://github.com/wmo-im/pywiscat/releases/new)

# bump version back to dev
vi pywiscat/__init__.py  # update __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.3.0.tar.gz (11.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.3.0-py2.py3-none-any.whl (15.6 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: pywiscat-0.3.0.tar.gz
  • Upload date:
  • Size: 11.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.3.0.tar.gz
Algorithm Hash digest
SHA256 cd0cd2459e7a16bc1104b693c86e6882d4d6e80db19235e6d39fddbdd3bc3858
MD5 038d0eddc289f81f6a9e3cd4607de0f2
BLAKE2b-256 34e163cb6968a598a4aedffb70594910aab19515f5f60795e2fb7064a84164c2

See more details on using hashes here.

File details

Details for the file pywiscat-0.3.0-py2.py3-none-any.whl.

File metadata

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

File hashes

Hashes for pywiscat-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bb324883e888ebecae8245cc53f6c61164ccc78e6ded6e2e0fdcf672f6bb035e
MD5 cb97b9ef5a61ce0fde607360f90d3e73
BLAKE2b-256 ff45fcf1b3c74d0a754414e7a182d3a63571dbac38e25d830ec3dd3c87dfc19f

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