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-2026 Siemens
The project is licensed under the MIT license. SPDX-License-Identifier: MIT
SBOM
For an up-to-date CycloneDX SBOM, please have a look at the SBOM folder.
Metadata
Release files for sw360 1.12.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sw360-1.12.0.tar.gz | 28.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sw360-1.12.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 70.8 kB
Release files / sw360-1.12.0.tar.gz
| Download URL | sw360-1.12.0.tar.gz |
|---|---|
| Size | 28.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74dc8a08fb9995cfbef056097afe8a3dd1e29f5ede1e946c45d5a31e1f4a07a1
|
|
BLAKE2b-256 checksum How to use checksums |
8c1acc1318d98eb2c90c9a4b13efba67dcbff1529c1e03928b7039d75ae7a95c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.7 Windows/11
|
Release files / sw360-1.12.0-py3-none-any.whl
| Download URL | sw360-1.12.0-py3-none-any.whl |
|---|---|
| Size | 42.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e8aacb6923859f20838c63d68ec66fc21b8d264c842ce80f325e28756dfbfb0
|
|
BLAKE2b-256 checksum How to use checksums |
b745d98ca0229478cad29346e3ccb7c394eafed2e0a66ec1db0dcb3928ea52e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.7 Windows/11
|