Code Monkey home page Code Monkey logo

sw360python's Introduction

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-2024 Siemens

The project is licensed under the MIT license. SPDX-License-Identifier: MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.