Fossology objects

The Python objects derived from the REST data.

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.ApiInfo(name, description, version, security, contact, license, fossology, **kwargs)

FOSSology API info.

Represents the info endpoint of FOSSology API.

Parameters:
  • name (string) – the name of the API service

  • description (string) – additional information

  • version (string) – current API version

  • security (list) – security methods allowed

  • contact (string) – email contact from the API documentation

  • license (ApiLicense object) – licensing of the API

  • fossology (FossologyServer object) – information about FOSSology server

class fossology.obj.ApiLicense(name, url)

FOSSology API License.

Parameters:
  • name (string) – name of the API license

  • url (string) – link to the license text

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.FileInfo(view_info, meta_info, package_info, tag_info, reuse_info, **kwargs)

FOSSology file info response.

Represents a FOSSology file info response.

Parameters:
  • view_info (Object) – view info of the file

  • meta_info (Object) – meta info of the file

  • package_info (Object) – package info of the file

  • tag_info (Object) – tag info of the file

  • reuse_info (Object) – reuse info of the file

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

class fossology.obj.Findings(scanner: list, conclusion: list | None = None, copyright: list | None = 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 (list) – 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.FossologyServer(version, branchName, commitHash, commitDate, buildDate)

FOSSology server info.

Parameters:
  • version (string) – version of the FOSSology server (e.g. 4.0.0)

  • branchName (string) – branch deployed on the FOSSology server

  • commitHash (string) – hash of commit deployed on the FOSSology server

  • commitDate (string) – date of commit deployed on the FOSSology server in ISO8601 format

  • buildDate (string) – date on which packages were built in ISO8601 format

class fossology.obj.GetBulkHistory(bulkId: int, clearingEventId: int, text: str, matched: bool, tried: bool, addedLicenses: Iterable[str], removedLicenses: Iterable[str], **kwargs)

Bulk history.

Represents the bulk history of a specified item.

Parameters:
  • bulkId (int) – the bulk id

  • clearingEventId (int) – the event id associated with the bulk

  • text (str) – scan reference text

  • matched (bool) – whether matched or not

  • tried (bool) – whether tried or not

  • addedLicenses (List[str]) – list of license shortnames added to the scan

  • removedLicenses (List[str]) – list of license shortnames removed to the scan

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

class fossology.obj.GetClearingHistory(date: str, username: str, scope: str, type: str, addedLicenses: Iterable[str], removedLicenses: Iterable[str], **kwargs)

Clearing history.

Represents the clearing history of a specified item.

Parameters:
  • date (string) – date of the clearing history

  • username (string) – username of the user who created the decision

  • scope (str) – scope of the clearing

  • type (str) – type of the clearing

  • addedLicenses (List[str]) – list of license shortnames added to the decision

  • removedLicenses (List[str]) – list of license shortnames removed to the decision

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

class fossology.obj.GetPrevNextItem(prevItemId: int, nextItemId: int, **kwargs)

PrevNext item for the clearing history.

Represents the prev-next item list for the clearing history.

Parameters:
  • prevItemId (int) – id of the previous item

  • nextItemId (int) – id of the next item

  • kwargs (key word argument) – handle any other job 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.HealthInfo(status, scheduler, db, **kwargs)

FOSSology server health info.

Represents the health endpoint of FOSSology API.

Parameters:
  • status (string) – the overall status of the API service (OK, WARN, ERROR)

  • scheduler (Status object) – the status of the FOSSology scheduler

  • db (Status object) – the status of the FOSSology DB

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(shortName, fullName, text, url, risk, isCandidate, id=None, **kwargs)

FOSSology license.

Represents a FOSSology license.

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

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

  • text (string) – the text of the license

  • url (string) – URL of the license text

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

  • isCandidate (bool) – is the license a candidate?

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

to_dict()

Get a directory with the license data

Returns:

the license data

Return type:

dict

to_json() str

Get a JSON object with the license data

Returns:

the license data

Return type:

JSON

class fossology.obj.Obligation(id, topic, type, text, classification, comment, **kwargs)

FOSSology license obligation.

Represents a FOSSology license obligation.

Parameters:
  • id (int) – the ID of the obligation

  • topic (string) – the topic of the obligation

  • type (string) – the type of the obligation

  • text (string) – the text of the obligation

  • classification (string) – level of attention it should raise in the clearing process

  • comment (string) – comment for the obligation

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

class fossology.obj.PermGroups(perm: str, group_pk: str, group_name: str)

GroupIds with their respective permissions for a upload

Represents the group permissions for a FOSSology upload.

Parameters:
  • perm (str) – the permission

  • group_pk (str) – the id of the group

  • group_name (str) – the name of the group

class fossology.obj.SearchResult(upload, uploadTreeId, filename, **kwargs)

Search result.

Represents a search response from FOSSology API.

Parameters:
  • upload (Upload) – upload where the searched file has been found

  • uploadTreeId (int) – id of the upload tree

  • filename (string) – filename of the tree item

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

class fossology.obj.Status(status)

FOSSology server status

Represent the status of FOSSology sub-systems

Parameters:

status (string) – the status of the sub-system (OK, ERROR)

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.Upload(folderid, foldername, id, description, uploadname, uploaddate, assignee=None, assigneeDate=None, closingDate=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

  • assignee (string) – the user who is assigned to the upload

  • assigneeDate (string) – the date of the assignment

  • closingDate (string) – the date of the closing

  • 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.UploadCopyrights(copyright: str, filePath: list[str], **kwargs)

Copyright findings in a FOSSology upload

Represents copyright matches of a FOSSology upload.

Parameters:
  • copyright (str) – the copyright

  • filePath (list) – relative file path

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

class fossology.obj.UploadLicenses(filePath: str, findings: dict, **kwargs)

FOSSology upload licenses.

Represents licenses and copyright matches of a FOSSology upload.

Parameters:
  • filePath (str) – relative file path

  • findings (Findings) – the licenses and copyrights findings

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

class fossology.obj.UploadPermGroups(publicPerm: str, permGroups: list, **kwargs)

Upload permissions

Represents the permissions for a FOSSology upload.

Parameters:
  • publicPerm (str) – the public permission of the group

  • permGroups (array) – array of permGroup objects for the upload

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

class fossology.obj.User(id: int, name: str, description: str, email: str | None = None, accessLevel: int | None = None, rootFolderId: int | None = None, emailNotification: str | None = None, default_group: str | None = None, agents: dict | None = None, **kwargs: dict)

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

class fossology.obj.UserGroupMember(user: User, group_perm: int, **kwargs: dict)

FOSSology group member.

Represents a member of a group.

Parameters:
  • user (User) – the user data structure of the member

  • group_perm (int) – the permission of the user in the group (0: User, 1: Admin, 2: Advisor)

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