A library to automate Fossology from Python scripts
Project description
A simple wrapper for the Fossology REST API.
See the OpenAPI specification used to implement this library.
Compatible with API version 1.0.16
Documentation
Usage
Installation
This project is available as Python package on PyPi.org.
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 (the generated static site must be pushed to the gh-pages branch):
git clone -b gh-pages git@github.com:fossology/fossology-python.git docs/ poetry run sphinx-build docs-source docs/ cd docs/ # Create a new branch to be merged into gh-pages and commit your changes
Cleanup builds:
rm -r dist/ build/ docs/
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:
docker pull fossology/fossology docker run --name fossology -p 80:80 fossology/fossology
Start the complete test suite or a specific test case (and generate coverage report):
poetry run coverage run --source=fossology tests/tests.py poetry run coverage report -m poetry run coverage html
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fossology-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf94c67c7cd68c035d8881eba31e779f7b0b65d2ef9e6c1849a1497a27a320ff |
|
MD5 | 8eb824f9b68d97ed529fed4873ecbb7f |
|
BLAKE2b-256 | a71c3c2b0cfee643b00938b1b6b5d2c10390acee2749f62fae1d15339c15269a |