[![flake8](https://github.com/wmo-im/pywis-topics/workflows/flake8/badge.svg)](https://github.com/wmo-im/pywis-topics/actions)
[![main](https://github.com/wmo-im/pywis-topics/workflows/main/badge.svg)](https://github.com/wmo-im/pywis-topics/actions)
# 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](https://pip.pypa.io)
utility:
```bash
pip3 install pywis-topics
```
### Requirements
- Python 3
- [virtualenv](https://virtualenv.pypa.io)
### Dependencies
Dependencies are listed in [requirements.txt](requirements.txt). Dependencies
are automatically installed during pywis-topics installation.
### Installing pywis-topics
```bash
# 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/wmo-im/pywis-topics.git
cd pywis-topics
python3 setup.py install
```
## Running
First check pywis-topics was correctly installed
```bash
pywis-topics --version
# sync WTH bundle
pywis-topics bundle sync
```
### Listing and validation
```bash
# validate a WIS2 topic hierarchy
pywis-topics topic validate origin/a/wis2/ca-eccc-msc
# validate a WIS2 topic hierarchy in no-strict mode
pywis-topics topic validate --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 origin/a/wis2/+/data/core --no-strict
```
### Centre identification validation
```bash
# validate a centre-id
pywis-topics centre-id 123
```
### Using the API
Python examples:
```python
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
```bash
# 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
```bash
# create release (x.y.z is the release version)
vi pywis_topics/__init__.py # update __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 setup.py sdist bdist_wheel --universal
twine upload dist/*
# publish release on GitHub (https://github.com/wmo-im/pywis-topics/releases/new)
# bump version back to dev
vi pywis_topics/__init__.py # update __version__
git commit -am 'back to dev'
git push origin main
```
### Code Conventions
* [PEP8](https://www.python.org/dev/peps/pep-0008)
### Bugs and Issues
All bugs, enhancements and issues are managed on [GitHub](https://github.com/wmo-im/pywis-topics/issues).
## Contact
* [Tom Kralidis](https://github.com/tomkralidis)
Raw data
{
"_id": null,
"home_page": "https://github.com/wmo-im/pywis-topics",
"name": "pywis-topics",
"maintainer": "Tom Kralidis",
"docs_url": null,
"requires_python": null,
"maintainer_email": "tomkraldis@gmail.com",
"keywords": "WIS2 WTH topics",
"author": "Tom Kralidis",
"author_email": "tomkralidis@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/10/53/be19e4455a174460c0b2a4c9b7817a30010809814fae22837d7ba618b111/pywis-topics-0.3.2.tar.gz",
"platform": "all",
"description": "[![flake8](https://github.com/wmo-im/pywis-topics/workflows/flake8/badge.svg)](https://github.com/wmo-im/pywis-topics/actions)\n[![main](https://github.com/wmo-im/pywis-topics/workflows/main/badge.svg)](https://github.com/wmo-im/pywis-topics/actions)\n\n# pywis-topics\n\n## Overview\n\npywis-topics is a utility to work with the WIS2 Topic Hierarchy\n\n## Installation\n\nThe easiest way to install pywis-topics is via the Python [pip](https://pip.pypa.io)\nutility:\n\n```bash\npip3 install pywis-topics\n```\n\n### Requirements\n- Python 3\n- [virtualenv](https://virtualenv.pypa.io)\n\n### Dependencies\nDependencies are listed in [requirements.txt](requirements.txt). Dependencies\nare automatically installed during pywis-topics installation.\n\n### Installing pywis-topics\n\n```bash\n# setup virtualenv\npython3 -m venv --system-site-packages pywis-topics\ncd pywis-topics\nsource bin/activate\n\n# clone codebase and install\ngit clone https://github.com/wmo-im/pywis-topics.git\ncd pywis-topics\npython3 setup.py install\n```\n\n## Running\n\nFirst check pywis-topics was correctly installed\n\n```bash\npywis-topics --version\n\n# sync WTH bundle\npywis-topics bundle sync\n```\n\n### Listing and validation\n\n```bash\n# validate a WIS2 topic hierarchy\npywis-topics topic validate origin/a/wis2/ca-eccc-msc\n\n# validate a WIS2 topic hierarchy in no-strict mode\npywis-topics topic validate --no-strict origin/a/wis2/fake-centre-id/data/core\n\n# list children of a given WIS2 topic hierarchy level\npywis-topics topic list wis2/a\n\n# validate a WIS2 topic hierarchy with wildcards (needs no-strict mode)\npywis-topics topic validate origin/a/wis2/+/data/core --no-strict\n```\n\n### Centre identification validation\n\n```bash\n# validate a centre-id\npywis-topics centre-id 123\n```\n\n### Using the API\n\nPython examples:\n\n```python\nfrom pywis_topics.centre_id import CentreId\nfrom pywis_topics.topics import TopicHierarchy\n\nth = TopicHierarchy()\n\nth.validate('origin/a/wis2/ca-eccc-msc/data/core')\nth.list_children('origin/a/wis2')\n\nth.validate('origin/a/wis2/fake-centre-id/data/core', strict=False)\n\nth.validate('origin/a/wis2/+/data/#', strict=False)\n\ncid = CentreId('ca-centre123')\ncid.validate()\n```\n\n## Development\n\n### Running Tests\n\n```bash\n# install dev requirements\npip3 install -r requirements-dev.txt\n\n# run tests like this:\npython3 tests/run_tests.py\n\n# or this:\npython3 setup.py test\n```\n\n## Releasing\n\n```bash\n# create release (x.y.z is the release version)\nvi pywis_topics/__init__.py # update __version__\ngit commit -am 'update release version x.y.z'\ngit push origin main\ngit tag -a x.y.z -m 'tagging release version x.y.z'\ngit push --tags\n\n# upload to PyPI\nrm -fr build dist *.egg-info\npython3 setup.py sdist bdist_wheel --universal\ntwine upload dist/*\n\n# publish release on GitHub (https://github.com/wmo-im/pywis-topics/releases/new)\n\n# bump version back to dev\nvi pywis_topics/__init__.py # update __version__\ngit commit -am 'back to dev'\ngit push origin main\n```\n\n### Code Conventions\n\n* [PEP8](https://www.python.org/dev/peps/pep-0008)\n\n### Bugs and Issues\n\nAll bugs, enhancements and issues are managed on [GitHub](https://github.com/wmo-im/pywis-topics/issues).\n\n## Contact\n\n* [Tom Kralidis](https://github.com/tomkralidis)\n",
"bugtrack_url": null,
"license": "Apache Software License",
"summary": "pywis-topics is a utility to work with the WIS2 Topic Hierarchy",
"version": "0.3.2",
"project_urls": {
"Homepage": "https://github.com/wmo-im/pywis-topics"
},
"split_keywords": [
"wis2",
"wth",
"topics"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4ee1004dc0355c8212d2a8cbe3914c819e4fbe89e7be63b33dcb204d03ce1a17",
"md5": "57253709754c9e278e0e6bdf5c7fe37e",
"sha256": "38218f2a09904e86a6828cc691f17e2e66e9839fed0549d6f2dd2fde1448e656"
},
"downloads": -1,
"filename": "pywis_topics-0.3.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "57253709754c9e278e0e6bdf5c7fe37e",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 17262,
"upload_time": "2024-04-22T14:40:22",
"upload_time_iso_8601": "2024-04-22T14:40:22.153548Z",
"url": "https://files.pythonhosted.org/packages/4e/e1/004dc0355c8212d2a8cbe3914c819e4fbe89e7be63b33dcb204d03ce1a17/pywis_topics-0.3.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1053be19e4455a174460c0b2a4c9b7817a30010809814fae22837d7ba618b111",
"md5": "09fd333d9f2025c7b7a04d537d47be7b",
"sha256": "131fa1a3e7961677fd8d51d7b8072ffa505f10b2215e45c4ac92744ddb0aec88"
},
"downloads": -1,
"filename": "pywis-topics-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "09fd333d9f2025c7b7a04d537d47be7b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14298,
"upload_time": "2024-04-22T14:40:23",
"upload_time_iso_8601": "2024-04-22T14:40:23.214096Z",
"url": "https://files.pythonhosted.org/packages/10/53/be19e4455a174460c0b2a4c9b7817a30010809814fae22837d7ba618b111/pywis-topics-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-22 14:40:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "wmo-im",
"github_project": "pywis-topics",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "click",
"specs": []
}
],
"lcname": "pywis-topics"
}