pywis-topics


Namepywis-topics JSON
Version 0.3.5 PyPI version JSON
download
home_pagehttps://github.com/wmo-im/pywis-topics
Summarypywis-topics is a utility to work with the WIS2 Topic Hierarchy
upload_time2024-08-29 00:38:24
maintainerTom Kralidis
docs_urlNone
authorTom Kralidis
requires_pythonNone
licenseApache Software License
keywords wis2 wth topics
VCS
bugtrack_url
requirements click
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![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/9c/b1/587564200e11fd45201a34cbaf3bb6e37cc8ace9309609f093f4bd1b6d73/pywis-topics-0.3.5.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.5",
    "project_urls": {
        "Homepage": "https://github.com/wmo-im/pywis-topics"
    },
    "split_keywords": [
        "wis2",
        "wth",
        "topics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "14827fe738be4b1a7302dfbbfb4b3047f21a1feccdd6d5f7cb114e91fc27bf55",
                "md5": "778b039d5f0100af4a18139d87232e40",
                "sha256": "4cf1afcb4d0c3fdfca43759ce92a03f3e0c62703dab5ab12e43ddc02d8f6e99e"
            },
            "downloads": -1,
            "filename": "pywis_topics-0.3.5-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "778b039d5f0100af4a18139d87232e40",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 19869,
            "upload_time": "2024-08-29T00:38:23",
            "upload_time_iso_8601": "2024-08-29T00:38:23.065177Z",
            "url": "https://files.pythonhosted.org/packages/14/82/7fe738be4b1a7302dfbbfb4b3047f21a1feccdd6d5f7cb114e91fc27bf55/pywis_topics-0.3.5-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9cb1587564200e11fd45201a34cbaf3bb6e37cc8ace9309609f093f4bd1b6d73",
                "md5": "0f40e50eeafe83d98cf8b32f4b41d7aa",
                "sha256": "b8d21d80c02f4d8c64b3ca3bf3c9d405f5ad3c06c10b918e4ccb9619fa567c1b"
            },
            "downloads": -1,
            "filename": "pywis-topics-0.3.5.tar.gz",
            "has_sig": false,
            "md5_digest": "0f40e50eeafe83d98cf8b32f4b41d7aa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 15518,
            "upload_time": "2024-08-29T00:38:24",
            "upload_time_iso_8601": "2024-08-29T00:38:24.014696Z",
            "url": "https://files.pythonhosted.org/packages/9c/b1/587564200e11fd45201a34cbaf3bb6e37cc8ace9309609f093f4bd1b6d73/pywis-topics-0.3.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-29 00:38:24",
    "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"
}
        
Elapsed time: 0.66046s