Python interface to the SW360 software component catalogue
Project description
SW360 Base Library for Python
This Python project implements the REST API of SW360 and allows an easy way to interact with SW360.
Documentation
Have a look at the documentation: https://sw360.github.io/sw360python/
Usage
Installation
This project is available as Python package on PyPi.org.
Install sw360 and required dependencies:
pip install sw360 requests
Using the API
-
Get a REST API token from your SW360 server
-
Export required environment variables (optionally but recommended):
export SW360ProductionToken=<your_api_token>
-
Start using the API:
import sw360 client = sw360.SW360(sw360_url, sw360_api_token)
Contribute
- All contributions in form of bug reports, feature requests or merge requests!
- Use proper docstrings to document
functions and classes - Extend the testsuite poetry run pytest with the new functions/classes
- The documentation website can automatically be generated by the Sphinx autodoc extension
Build
Building the Documentation
The documentation of the project is built using Sphinx:
poetry run sphinx-build .\docs-source\ .\docs\
Building Python package
For building the library, you need Poetry.
The build is then triggered using
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):
poetry run pytest
or
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 check_project.py
shows how to use the library to retrieve some information
of a given project on SW360. This requires colorama>=0.4.1.
License
Copyright 2019-2024 Siemens
The project is licensed under the MIT license. SPDX-License-Identifier: MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sw360-1.7.0.tar.gz
.
File metadata
- Download URL: sw360-1.7.0.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.4 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1322c33c8c08c3e257e1f9033b17321f3d643056338bcde02c4df7eed11ad25 |
|
MD5 | 80f7ecd079c96eba87c0b493455dcee2 |
|
BLAKE2b-256 | d377acb73c070a0e95a374a96f3e607e6a7d23549c7698f853b8393c197a7f75 |
File details
Details for the file sw360-1.7.0-py3-none-any.whl
.
File metadata
- Download URL: sw360-1.7.0-py3-none-any.whl
- Upload date:
- Size: 30.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.4 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0146972bcead8327ec32390fdcf0d43180e4480dd3ac436d16d50f15b61c2a0 |
|
MD5 | ae2f59d9a29b7431a1117e628741c57a |
|
BLAKE2b-256 | 566bcb512930bb09781bc0d228fb96a375045af09947a204d892a0cf66fec8ac |