Coder Social home page Coder Social logo

gmishx / fossology-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fossology/fossology-python

0.0 1.0 0.0 910 KB

Python wrapper for the Fossology API

Home Page: https://fossology.github.io/fossology-python

License: MIT License

Python 100.00%

fossology-python's Introduction

License PyPI Version Static Checks Fossology Tests Coverage

A simple wrapper for the Fossology REST API.

See the OpenAPI specification used to implement this library.

Compatible from API version 1.0.16 up to 1.2.1

Documentation

See fossology-python on Github Pages.

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
  • Extend the testsuite poetry run pytest 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 [email protected]: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/ docs/

Tag

Each new release gets a new tag with important information about the changes added to the new release:

git tag -a vx.x.x -m "New major/minor/patch release x.x.x"
git push origin vx.x.x

Add required information in the corresponding release in the Github project.

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
    tar xJf tests/files/base-files_11.tar.xz -C /tmp
    docker run --mount src="/tmp",dst=/tmp,type=bind --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 -m pytest
    poetry run coverage report -m
    poetry run coverage html

fossology-python's People

Contributors

alpianon avatar deveaud-m avatar

Watchers

 avatar

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.