Fossology objects

The Python objects derived from the REST data.

class fossology.obj.AccessLevel(value)

Available access levels for uploads:

PRIVATE: the upload will only be visible to the owner

PROTECTED: ?

PUBLIC: the upload will be visible for everyone

class fossology.obj.Agents(bucket, copyright_email_author, ecc, keyword, mimetype, monk, nomos, ojo, package, **kwargs)

FOSSology agents.

Represents the agents currently configured for a given user.

Parameters
  • bucket (boolean) – run bucket agent on every upload

  • copyright_email_author (boolean) – run copyright_email_author agent on every upload

  • ecc (boolean) – run ecc agent on every upload

  • keyword (boolean) – run keyword agent on every upload

  • mimetype (boolean) – run mimetype agent on every upload

  • monk (boolean) – run monk agent on every upload

  • nomos (boolean) – run nomos agent on every upload

  • ojo (boolean) – run ojo agent on every upload

  • package (boolean) – run package agent on every upload

  • kwargs (key word argument) – handle any other agent provided by the fossology instance

to_dict()

Get a directory with the agent configuration

Returns

the agents configured for the current user

Return type

dict

to_json()

Get a JSON object with the agent configuration

Returns

the agents configured for the current user

Return type

JSON

class fossology.obj.ClearingStatus(value)

Clearing statuses

class fossology.obj.File(hash, findings, **kwargs)

FOSSology file response from filesearch.

Represents a FOSSology filesearch response.

Parameters
  • hash (Hash) – the hash information of the file

  • findings (Findings) – the license findings in that file

  • kwargs (key word argument) – handle any other license information provided by the fossology instance

class fossology.obj.Findings(scanner, conclusion, copyright=None, **kwargs)

FOSSology license findings.

Represents FOSSology license findings.

Parameters
  • scanner (list) – the list of licenses found by the specified scanners

  • conclusion (list) – the concluded license by user of for a package

  • copyright – the copyrights found in the package

  • kwargs (key word argument) – handle any other finding information provided by the fossology instance

class fossology.obj.Folder(id, name, description, parent, **kwargs)

FOSSology folder.

Represents a FOSSology folder.

Parameters
  • id (int) – the ID of the folder

  • name (string) – the name of the folder

  • description (string) – further information about the folder

  • parent (int) – the ID of the parent folder

  • kwargs (key word argument) – handle any other folder information provided by the fossology instance

class fossology.obj.Group(id, name, **kwargs)

FOSSology group.

Represents a FOSSology group.

Parameters
  • id (int) – the ID of the group

  • name (string) – the name of the group

  • kwargs (key word argument) – handle any other folder information provided by the fossology instance

class fossology.obj.Hash(sha1, md5, sha256, size, **kwargs)

FOSSology hash.

Represents a FOSSology file hash values.

Parameters
  • sha1 (string) – the SHA1 hash sum of the file

  • md5 (string) – the MDA check sum of the file

  • sha256 (string) – the SHA256 hash sum of the file

  • size (int) – the size of the file in bytes

  • kwargs (key word argument) – handle any other hash information provided by the fossology instance

class fossology.obj.Job(id, name, queueDate, uploadId, userId, groupId, eta, status, **kwargs)

FOSSology job.

Represents a FOSSology job.

Parameters
  • id (int) – the ID of the job

  • name (string) – the name of the job

  • queueDate (string) – the start date of the job

  • uploadId (int) – the ID of the upload

  • userId (int) – the ID of the user wo started the job

  • groupId (int) – the ID of the job’s group

  • eta (string) – the estimated termination time

  • status (string) – the status of the job

  • kwargs (key word argument) – handle any other job information provided by the fossology instance

class fossology.obj.License(id, shortName, fullName, text, risk, **kwargs)

FOSSology license.

Represents a FOSSology license.

Parameters
  • id (int) – the ID of the license

  • shortName (string) – the short name of the license

  • fullName (string) – the full name of the license

  • text (string) – the text of the license

  • risk (int) – the risk level of the license

  • kwargs (key word argument) – handle any other folder information provided by the fossology instance

class fossology.obj.Licenses(filePath, findings=None, **kwargs)

FOSSology file license findings.

Represents a FOSSology licenses response.

Parameters
  • filePath (string) – the path of the file in the specified upload

  • findings (Findings) – the license findings in that file

  • kwargs (key word argument) – handle any other license information provided by the fossology instance

class fossology.obj.ReportFormat(value)

Available report format: DEP5, SPDX2, SPDX2TV, READMEOSS, UNIFIEDREPORT

class fossology.obj.SearchTypes(value)

Type of item that can be searched: ALLFILES, CONTAINERS, DIRECTORIES

class fossology.obj.Summary(id, uploadName, mainLicense, uniqueLicenses, totalLicenses, uniqueConcludedLicenses, totalConcludedLicenses, filesToBeCleared, filesCleared, clearingStatus, copyrightCount, **kwargs)

FOSSology upload summary.

Represents a FOSSology upload summary.

Parameters
  • id (int) – the ID of the upload

  • uploadName (string) – the name of the upload

  • mainLicense (string) – the main upload license

  • uniqueLicenses (int) – the number of unique licenses

  • totalLicenses (int) – the total number of licenses

  • uniqueConcludedLicenses (int) – the number of unique concluded licenses

  • totalConcludedLicenses (int) – the total number of concluded licenses

  • filesToBeCleared (int) – the number of remaining files to be cleared

  • filesCleared (int) – the number of files already cleared

  • clearingStatus (string) – the clearing status

  • copyrightCount (int) – the number of copyrights found

  • kwargs (key word argument) – handle any other summary information provided by the fossology instance

class fossology.obj.TokenScope(value)

Scope for API tokens:

READ: Read only access, limited only to “GET” calls

WRITE: Read/Write access, required for calls other than “GET”

class fossology.obj.Upload(folderid, foldername, id, description, uploadname, uploaddate, filesize=None, filesha1=None, hash=None, **kwargs)

FOSSology upload.

Represents a FOSSology upload.

Parameters
  • folderid (int) – the ID of the upload folder

  • foldername (string) – the name of the upload folder

  • id (int) – the ID of the upload

  • description (string) – further information about the upload

  • uploadname (string) – the name of the upload (default: the name of the upload file)

  • uploaddate (string) – the date of the upload

  • hash (Hash) – the hash data of the uploaded file

  • kwargs (key word argument) – handle any other upload information provided by the fossology instance

class fossology.obj.User(id, name, description, email, accessLevel, rootFolderId, emailNotification, agents=None, **kwargs)

FOSSology user.

Represents the user currently authenticated against the FOSSology server.

Parameters
  • id (int) – the user ID

  • name (string) – the user name

  • description (string) – further information about the user

  • email (string) – the user’s email

  • accessLevel (string) – TBD

  • rootFolderId (int) – the ID of the user’s root folder

  • emailNotification (boolean) – are email notifications configured for that user?

  • agents (Agents) – the default agent configuration for the user

  • kwargs (key word argument) – handle any other user information provided by the fossology instance