pywis-topics
Overview
pywis-topics is a utility to work with the WIS2 Topic Hierarchy
Installation
The easiest way to install pywis-topics is via the Python pip utility:
pip3 install pywis-topics
Requirements
- Python 3
- virtualenv
Dependencies
Dependencies are listed in pyproject.toml. Dependencies are automatically installed during pywis-topics installation.
Installing pywis-topics
# setup virtualenv
python3 -m venv --system-site-packages pywis-topics
cd pywis-topics
source bin/activate
# clone codebase and install
git clone https://github.com/World-Meteorological-Organization/pywis-topics.git
cd pywis-topics
pip3 install .
Running
First check pywis-topics was correctly installed
pywis-topics --version
# sync WTH bundle
pywis-topics bundle sync
Listing and validating topics for subscription
# validate a WIS2 topic hierarchy
pywis-topics topic validate subscription origin/a/wis2/ca-eccc-msc
# validate a WIS2 topic hierarchy in no-strict mode
pywis-topics topic validate subscription --no-strict origin/a/wis2/fake-centre-id/data/core
# list children of a given WIS2 topic hierarchy level
pywis-topics topic list wis2/a
# validate a WIS2 topic hierarchy with wildcards (needs no-strict mode)
pywis-topics topic validate subscription origin/a/wis2/+/data/core --no-strict
Validating topics for publication
# validate a WIS2 topic hierarchy
pywis-topics topic validate publication origin/a/wis2/ca-eccc-msc
pywis-topics topic validate publication origin/a/wis2/ca-eccc-msc/ocean
pywis-topics topic validate publication origin/a/wis2/us-noaa-nws/data/core/weather/surface-based-observations/synop
# validate a WIS2 topic hierarchy in no-strict mode
pywis-topics topic validate publication --no-strict origin/a/wis2/fake-centre-id/data/core
Centre identification validation
# validate a centre-id
pywis-topics centre-id 123
Using the API
Python examples:
from pywis_topics.centre_id import CentreId
from pywis_topics.topics import TopicHierarchy
th = TopicHierarchy()
th.validate('origin/a/wis2/ca-eccc-msc/data/core')
th.list_children('origin/a/wis2')
th.validate('origin/a/wis2/fake-centre-id/data/core', strict=False)
th.validate('origin/a/wis2/+/data/#', strict=False)
cid = CentreId('ca-centre123')
cid.validate()
Development
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 main
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/World-Meteorological-Organization/pywis-topics/releases/new)
# bump version back to dev
vi pyproject.toml # update [project]/version
git commit -am 'back to dev'
git push origin main
Code Conventions
Bugs and Issues
All bugs, enhancements and issues are managed on GitHub.
Contact
Metadata
Release files for pywis-topics 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pywis_topics-0.5.1.tar.gz | 15.0 kB | Without provenance | Details for pywis_topics-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pywis_topics-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for pywis_topics-0.5.1-py3-none-any.whl |
Total release size: 33.2 kB
Release files / pywis_topics-0.5.1.tar.gz
| Download URL | pywis_topics-0.5.1.tar.gz |
|---|---|
| Size | 15.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8851d35c61e6e6798fb3da79287e94a7f5a465f8b8d80105032c9628db891149
|
|
BLAKE2b-256 checksum How to use checksums |
3384deb08cba2b43a1afc01cca9708cfe0cbb03934981787f2c245ba92b74495
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / pywis_topics-0.5.1-py3-none-any.whl
| Download URL | pywis_topics-0.5.1-py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
16a8741896a43dd3bc68e19536d98682a438957068bb4276380bd9fe0e01f320
|
|
BLAKE2b-256 checksum How to use checksums |
5fd2e195c064ae2425aadf26b5bc6e0a76d838980853f9ae058ad2902957dd16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for pywis-topics 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.