Fossology Folders

Methods used to access “folders/” endpoints.

class fossology.folders.Folders

Class dedicated to all “folders” related endpoints

copy_folder(folder, parent)

Copy a folder

Parameters
  • folder (Folder() object) – the Folder to be copied

  • parent (Folder() object) – the new parent folder

Returns

the updated folder

Return type

Folder() object

Raises

FossologyApiError – if the REST call failed

create_folder(parent, name, description=None, group=None)

Create a new (sub)folder

The name of the new folder must be unique under the same parent.

API Endpoint: POST /folders/{id}

Parameters
  • parent (Folder() object) – the parent folder

  • name (str) – the name of the folder

  • description (str) – a meaningful description for the folder (default: None)

  • group (string) – the name of the group chosen to create the folder (default: None)

Returns

the folder newly created (or already existing) - or None

Return type

Folder() object

Raises
delete_folder(folder)

Delete a folder

API Endpoint: DELETE /folders/{id}

Parameters

folder (Folder() object) – the Folder to be deleted

Raises

FossologyApiError – if the REST call failed

detail_folder(folder_id)

Get details of folder.

API Endpoint: GET /folders/{id}

Parameters

id (int) – the ID of the folder to be analysed

Returns

the requested folder

Return type

Folder() object

Raises

FossologyApiError – if the REST call failed

list_folders()

List all folders accessible to the authenticated user

API Endpoint: GET /folders

Returns

a list of folders

Return type

list()

Raises

FossologyApiError – if the REST call failed

move_folder(folder, parent)

Move a folder

Parameters
  • folder (Folder() object) – the Folder to be moved

  • parent (Folder() object) – the new parent folder

Returns

the updated folder - or None if the REST call failed

Return type

Folder() object

Raises

FossologyApiError – if the REST call failed

update_folder(folder, name=None, description=None)

Update a folder’s name or description

The name of the new folder must be unique under the same parent.

API Endpoint: PATCH /folders/{id}

Parameters
  • name (str) – the new name of the folder (optional)

  • description (str) – the new description for the folder (optional)

Returns

the updated folder

Return type

Folder() object

Raises

FossologyApiError – if the REST call failed