Skip to main content

A library to automate Fossology from Python scripts

Project description

Static Checks Action Fossology Tests Action

A simple wrapper for the Fossology REST API.

See the OpenAPI specification used to implement this library.

Usage

Installation

  • Install fossology and required dependencies:

    pip install fossology requests
    

Using the API

  • Get a REST API token either from the Fossology server under “User->Edit user account” or generate a token using the method available in this library:

    from fossology import fossology_token
    from fossology.obj import TokenScope
    
    FOSSOLOGY_SERVER = "https://fossology.example.com/"
    FOSSOLOGY_USER = "fossy"
    FOSSOLOGY_PASSWORD = "fossy"
    TOKEN_NAME = "fossy_token"
    
    token = fossology_token(
          FOSSOLOGY_SERVER,
          FOSSOLOGY_USER,
          FOSSOLOGY_PASSWORD,
          TOKEN_NAME,
          TokenScope.WRITE
    )
    
  • Start using the API:

    from fossology import Fossology
    
    foss = Fossology(
          FOSSOLOGY_SERVER,
          token,
          FOSSOLOGY_USER
    )
    

Contribute

Develop

  • All contributions in form of bug reports, feature requests or merge requests!
  • Use proper docstrings to document functions and classes
  • Don’t forget to extend the minimal testsuite with the new functions/classes
  • The documentation website can automatically be generated by the Sphinx autodoc extension

Build

  • You can build the PyPi package using poetry:

    poetry build
    
  • Build documentation:

    poetry run sphinx-build docs/source docs/build
    
  • Cleanup builds:

    rm -r dist/ build/ docs/build/
    

Test

The testsuite available in this project expects a running Fossology instance under the hostname fossology with the default admin user “fossy”.

Use the latest Fossology container from Docker hub.

  • Start the complete test suite or a specific test case:

    poetry run python fossology/tests/tests.py
    poetry run python fossology/tests/test_uploads.py
    

Project details


Release history Release notifications

Download files

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

Files for fossology, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size fossology-0.0.5-py3-none-any.whl (88.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size fossology-0.0.5.tar.gz (85.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page