Skip to main content

Python wrapper around FOSSology's REST API

Project description

py-fossology

Python wrapper around FOSSology's REST API.

Works with FOSSology version 3.5.0

Example usage

from fossology import Fossology

fossology = Fossology(server='http://localhost:8085/repo/',
                      auth={'username' : 'fossy',
                            'password' : 'fossy',
                            'token_scope' : 'write',
                            'token_expire' : '2019-09-07'
                            })


# Get the root folder
root_folder = fossology.folder(folder_id=1)


# Upload a file to the root folder
upload = fossology.new_upload(target_folder=root_folder, fileInput='/tmp/sample.tar')

# Schedule a scan on this new upload
job = upload.schedule_agents(agents='''{
   "analysis": {
     "bucket": true,
     "copyright_email_author": true,
     "ecc": true,
     "keyword": true,
     "mime": true,
     "monk": true,
     "nomos": true,
     "package": true
   },
   "decider": {
     "nomos_monk": true,
     "bulk_reused": true,
     "new_scanner": true
   },
   "reuse": {
     "reuse_upload": 0,
     "reuse_group": 0,
     "reuse_main": true,
     "reuse_enhanced": true
   }
 }''')


# Generate a report
report = upload.request_report_generation(reportFormat='unifiedreport')

# Download the report
report.download()

Documentation

TBD

Installation

Use the following command to install

pip install py-fossology

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

py-fossology-0.1.1.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distribution

py_fossology-0.1.1-py3-none-any.whl (9.3 kB view hashes)

Uploaded Python 3

Supported by

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