This release is a pre-release and may not be stable for production use.
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.dev2
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.dev2.tar.gz | 28.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sw360-1.12.0.dev2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 70.7 kB
Release files / sw360-1.12.0.dev2.tar.gz
| Download URL | sw360-1.12.0.dev2.tar.gz |
|---|---|
| Size | 28.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2fd17a48828f144695a47550cc4ae9d820155de932627928b08c13ed2eedb91
|
|
BLAKE2b-256 checksum How to use checksums |
e6407295b1af341e8dd879a7c99bce58f28c2d5ae9efffb3df8483dae2119d60
|
| 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.dev2-py3-none-any.whl
| Download URL | sw360-1.12.0.dev2-py3-none-any.whl |
|---|---|
| Size | 42.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a88987ad14d0518a03e084dc70a682db98862a22a1964ca82204c071a9ddd3c0
|
|
BLAKE2b-256 checksum How to use checksums |
7e68565b73229a5f669b811f446c508b2bb918c09061d7fb99b4a56a597bb496
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.13.7 Windows/11
|