Skip to main content

pywis-pubsub provides subscription and download capability of WMO data from WIS 2.0 infrastructure services

Project description

flake8

pywis-pubsub

Overview

pywis-pubsub provides subscription and download capability of WMO data from WIS 2.0 infrastructure services.

Installation

The easiest way to install pywis-pubsub is via the Python pip utility:

pip3 install pywis-pubsub

Requirements

Dependencies

Dependencies are listed in requirements.txt. Dependencies are automatically installed during pywis-pubsub installation.

Windows installations

Note that you will need Cython and Shapely Windows wheels for windows for your architecture prior to installing pywis-pubsub.

Installing pywis-pubsub

# setup virtualenv
python3 -m venv --system-site-packages pywis-pubsub
cd pywis-pubsub
source bin/activate

# clone codebase and install
git clone https://github.com/geopython/pywis-pubsub.git
cd pywis-pubsub
python3 setup.py build
python3 setup.py install

Running

cp pywis-pubsub-config-example.yml local.yml
vi local.yml # update accordingly

pywis-pubsub --version

# connect, and simply echo messages
pywis-pubsub subscribe --config local.yml

# connect, and download messages
pywis-pubsub subscribe --config local.yml --download

# connect, and filter messages by geometry
pywis-pubsub subscribe --config local.yml --bbox=-142,42,-52,84

# connect, and filter messages by geometry, increase debugging verbosity
pywis-pubsub subscribe --config local.yml --bbox=-142,42,-52,84 --verbosity=DEBUG

Using the API

# Python API examples go here

from pywis_pubsub.subscribe import MQTTPubSubClient

options = {
    'storage': {
        'type': 'fs',
        'path': '/tmp'
    },
    'bbox': [-90, -180, 90, 180]
}
topics = [
    'topic1',
    'topic2'
]

m = MQTTPubSubClient('mqtt://localhost:1883', options)
m.sub(topics)

Development

Running Tests

# install dev requirements
pip3 install -r requirements-dev.txt

# run tests like this:
python3 tests/run_tests.py

# or this:
python3 setup.py test

Releasing

rm -fr build dist *.egg-info
python3 setup.py sdist bdist_wheel --universal
twine upload dist/*

Code Conventions

Bugs and Issues

All bugs, enhancements and issues are managed on GitHub.

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

pywis-pubsub-0.1.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

pywis_pubsub-0.1.1-py2.py3-none-any.whl (17.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pywis-pubsub-0.1.1.tar.gz.

File metadata

  • Download URL: pywis-pubsub-0.1.1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/1.1.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.8.0 tqdm/4.64.0 CPython/3.7.8

File hashes

Hashes for pywis-pubsub-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f9f262e8bfc70af2fe8b3cc84ebe5888df19e2749de0f387ad80c6a29bb04bce
MD5 20091bdadec9a39216cc329e03d9355c
BLAKE2b-256 44e4db6ae958a9a9ab5c055f9e50b7ec67d705b902c8ad6d1c10479ad7887ed0

See more details on using hashes here.

File details

Details for the file pywis_pubsub-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: pywis_pubsub-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/1.1.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.8.0 tqdm/4.64.0 CPython/3.7.8

File hashes

Hashes for pywis_pubsub-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 382a631bcb0a46832e62655aa7548a5e121340654e6ba33ea0c7dc35a7bc2c35
MD5 06450f2e89449634af686fd826c90974
BLAKE2b-256 f9885612c1d061db9350d9bd5a28f6501dfd3e233e72d9e3007c911e4f40ea47

See more details on using hashes here.

Supported by

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