Skip to main content

Python interface to the SW360 software component catalogue

Project description

SW360 Base Library for Python

License Python Version PyPI Static checks Unit tests Coverage REUSE status

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sw360-1.12.0.dev1.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sw360-1.12.0.dev1-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

Details for the file sw360-1.12.0.dev1.tar.gz.

File metadata

  • Download URL: sw360-1.12.0.dev1.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.7 Windows/11

File hashes

Hashes for sw360-1.12.0.dev1.tar.gz
Algorithm Hash digest
SHA256 a2441ba5e1bcd94a5bba188fae92259767866f6dbe1cb2f0e421cae2be3e8d6f
MD5 93679c22b5e34d03c5f6e05a25e8907f
BLAKE2b-256 5ee15de7f8113a71df9b1703740c7fb81aff74e61d45b252f1cca52fef741707

See more details on using hashes here.

File details

Details for the file sw360-1.12.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: sw360-1.12.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.7 Windows/11

File hashes

Hashes for sw360-1.12.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 351764e55734c9db12604428117460da6a1805fdc52101b5b49011e4563e89b6
MD5 3116a3a70146399dc78c421ac2eee51f
BLAKE2b-256 5bd8da98285bdd2cf9ec8993ad8d306d3fa04c06a183075310c5fe88c2f22b7e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page