# CLI Support for Python
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sw360/clipython/blob/master/License.md)
[![Python Version](https://img.shields.io/badge/python-3.8%2C3.9%2C3.10%2C3.11-yellow?logo=python)](https://www.python.org/doc/versions/)
[![PyPI](https://shields.io/pypi/v/cli-support)](https://pypi.org/project/cli-support)
[![Static checks](https://github.com/sw360/clipython/actions/workflows/python-package.yml/badge.svg)](https://github.com/sw360/clipython/actions/workflows/python-package.yml)
[![Unit tests](https://github.com/sw360/clipython/actions/workflows/unit-test.yml/badge.svg)](https://github.com/sw360/clipython/actions/workflows/unit-test.yml)
Python library to read and write Component License Information (CLI) files. They can be
created by [FOSSology](https://www.fossology.org) and stored in
[SW360](https://www.eclipse.org/sw360/).
For more information about the CLI file format, please have a look at
[ComponentLicenseInformation.md](ComponentLicenseInformation.md).
## Usage
### Installation
This project is available as [Python package on PyPi.org](https://pypi.org/project/cli-support/).
Install cli_support and required dependencies:
```shell
pip install cli_support
```
### Required Packages
* none
## Using the API
* Start using the API:
```python
import cli_support
clifile = cli_support.CLI.CliFile()
clifile.read_from_file("cli_filename")
```
## Contribute
* All contributions in form of bug reports, feature requests or merge requests are welcome!
* Please use proper [docstrings](https://realpython.com/documenting-python-code/) to document
functions and classes.
* Extend the testsuite **poetry run pytest** with the new functions/classes
## Build
### Building Python package
For building the library, you need [Poetry](https://python-poetry.org/). Build is then
simply triggered using
```shell
poetry build
```
This creates the source and wheel files in ```dist/``` subdirectory -- which can then
be uploaded or installed locally using ```pip```.
## Test
Start the complete test suite or a specific test case (and generate coverage report):
```shell
poetry run pytest
```
or
```shell
poetry run coverage run -m pytest
poetry run coverage report -m --omit "*/site-packages/*.py"
poetry run coverage html --omit "*/site-packages/*.py"
```
## Demo
The script ``show_licenses.py`` shows how to use the library to retrieve some information
of a given CLI file.
```shell
python ./show_licenses.py ./test/testfiles/CLIXML_MIT_simple.xml
```
## License
Copyright 2019-2024 Siemens
The project is licensed under the MIT license.
SPDX-License-Identifier: MIT
Raw data
{
"_id": null,
"home_page": "https://github.com/sw360/clipython",
"name": "cli-support",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Thomas Graf",
"author_email": "thomas.graf@siemens.com",
"download_url": "https://files.pythonhosted.org/packages/89/44/522b7499014dd63881444e86cb44205802409377cbb0f7009f3f078e4fbc/cli_support-2.0.2.tar.gz",
"platform": null,
"description": "# CLI Support for Python\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sw360/clipython/blob/master/License.md)\n[![Python Version](https://img.shields.io/badge/python-3.8%2C3.9%2C3.10%2C3.11-yellow?logo=python)](https://www.python.org/doc/versions/)\n[![PyPI](https://shields.io/pypi/v/cli-support)](https://pypi.org/project/cli-support)\n[![Static checks](https://github.com/sw360/clipython/actions/workflows/python-package.yml/badge.svg)](https://github.com/sw360/clipython/actions/workflows/python-package.yml)\n[![Unit tests](https://github.com/sw360/clipython/actions/workflows/unit-test.yml/badge.svg)](https://github.com/sw360/clipython/actions/workflows/unit-test.yml)\n\nPython library to read and write Component License Information (CLI) files. They can be\ncreated by [FOSSology](https://www.fossology.org) and stored in\n[SW360](https://www.eclipse.org/sw360/).\n\nFor more information about the CLI file format, please have a look at\n[ComponentLicenseInformation.md](ComponentLicenseInformation.md).\n\n## Usage\n\n### Installation\n\nThis project is available as [Python package on PyPi.org](https://pypi.org/project/cli-support/). \nInstall cli_support and required dependencies:\n\n ```shell\n pip install cli_support\n ```\n\n### Required Packages\n\n* none\n\n## Using the API\n\n* Start using the API:\n\n ```python\n import cli_support\n clifile = cli_support.CLI.CliFile()\n clifile.read_from_file(\"cli_filename\")\n ```\n\n## Contribute\n\n* All contributions in form of bug reports, feature requests or merge requests are welcome!\n* Please use proper [docstrings](https://realpython.com/documenting-python-code/) to document\n functions and classes.\n* Extend the testsuite **poetry run pytest** with the new functions/classes\n\n## Build\n\n### Building Python package\n\nFor building the library, you need [Poetry](https://python-poetry.org/). Build is then\nsimply triggered using\n\n```shell\npoetry build\n```\n\nThis creates the source and wheel files in ```dist/``` subdirectory -- which can then\nbe uploaded or installed locally using ```pip```.\n\n## Test\n\nStart the complete test suite or a specific test case (and generate coverage report):\n\n```shell\npoetry run pytest\n```\n\nor\n\n```shell\npoetry run coverage run -m pytest\npoetry run coverage report -m --omit \"*/site-packages/*.py\"\npoetry run coverage html --omit \"*/site-packages/*.py\"\n```\n\n## Demo\n\nThe script ``show_licenses.py`` shows how to use the library to retrieve some information\nof a given CLI file.\n\n```shell\npython ./show_licenses.py ./test/testfiles/CLIXML_MIT_simple.xml\n```\n\n## License\n\nCopyright 2019-2024 Siemens\n\nThe project is licensed under the MIT license. \nSPDX-License-Identifier: MIT\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Support component license information (CLI) files",
"version": "2.0.2",
"project_urls": {
"Homepage": "https://github.com/sw360/clipython",
"Repository": "https://github.com/sw360/clipython"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ce54b2a5f4ec90ac7139fa8081b3aa6b5e9fa817f314d08d71ca4ff917e83c1b",
"md5": "4fed34869dc6ce837e03f0c1a84794f1",
"sha256": "f56759f129e2b204f0e84de2dc1ff0a7e1f9187d5d88f0b4e528e9d3acd7f080"
},
"downloads": -1,
"filename": "cli_support-2.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4fed34869dc6ce837e03f0c1a84794f1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 16198,
"upload_time": "2024-05-07T15:41:57",
"upload_time_iso_8601": "2024-05-07T15:41:57.557816Z",
"url": "https://files.pythonhosted.org/packages/ce/54/b2a5f4ec90ac7139fa8081b3aa6b5e9fa817f314d08d71ca4ff917e83c1b/cli_support-2.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8944522b7499014dd63881444e86cb44205802409377cbb0f7009f3f078e4fbc",
"md5": "c8128c3170a1dbac47230e36d27c7863",
"sha256": "5908aeb1fd1c66de6a0de40e10bb2a5cfb54114d928d9b40c478ec8423ddf499"
},
"downloads": -1,
"filename": "cli_support-2.0.2.tar.gz",
"has_sig": false,
"md5_digest": "c8128c3170a1dbac47230e36d27c7863",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 9276,
"upload_time": "2024-05-07T15:41:59",
"upload_time_iso_8601": "2024-05-07T15:41:59.167274Z",
"url": "https://files.pythonhosted.org/packages/89/44/522b7499014dd63881444e86cb44205802409377cbb0f7009f3f078e4fbc/cli_support-2.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-07 15:41:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sw360",
"github_project": "clipython",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "cli-support"
}