Package

class fabman.package.Package(requester: Requester, attributes: dict)

Handles all interaction with Package objects on the Fabman API

Initialize the Object. Stores the requester method to interact with the API for further calls

Parameters:
  • requester (Requester) – The Requester object to make requests with

  • attributes (dict) – The attributes to initialize this object with

create_credit(**kwargs) PackageCredit

Create a credit for this package. Takes no arguments.

Calls:

“POST /packages/{id}/credits” <https://fabman.io/api/v1/documentation#/packages/postPackagesIdCredits>

Returns:

Object with information and methods of the new credit

Return type:

fabman.package.PackageCredit

create_permission(**kwargs) PackagePermission

Create a new permission for this package. Gives new abilities to package hodlers.

Calls:

“POST /packages/{id}/permissions” <https://fabman.io/api/v1/documentation#/packages/postPackagesIdPermissions>

Returns:

Object with information and methods of the new permission

Return type:

fabman.package.PackagePermission

delete(**kwargs) Response

Deletes the package. Takes no arguments. WARNINGL: This is irreversible.

Calls:

“DELETE /packages/{id}” <https://fabman.io/api/v1/documentation#/packages/deletePackagesId>

Returns:

response information of call

Return type:

requests.Response

get_credit(credit_id, **kwargs) PackageCredit

Return a credit for this package given a credit_id.

Calls:

“GET /packages/{id}/credits/{creditId}” <https://fabman.io/api/v1/documentation#/packages/getPackagesIdCreditsCreditid>

Parameters:

credit_id (int) – ID of the credit to retrieve

Returns:

Object with information and methods of the credit

Return type:

fabman.package.PackageCredit

get_credits(**kwargs) PaginatedList

Return a PaginatedList of credits for this package

Calls: “GET /packages/{id}/credits” Documentation: https://fabman.io/api/v1/documentation#/packages/getPackagesIdCredits

Returns:

List of credits for this package

Return type:

fabman.paginated_list.PaginatedList

get_permission(permission_id, **kwargs) PackagePermission

Return a permission for this package given a permission_id.

Calls:

“GET /packages/{id}/permissions/{permissionId}” <https://fabman.io/api/v1/documentation#/packages/getPackagesIdPermissionsPermissionid>

Returns:

Object with information and methods of the permission

Return type:

fabman.package.PackagePermission

get_permissions(**kwargs) PaginatedList

Return a PaginatedList of permissions for the package.

Calls:

“GET /packages/{id}/permissions” <https://fabman.io/api/v1/documentation#/packages/getPackagesIdPermissions>

Returns:

List of permissions for the package

Return type:

fabman.paginated_list.PaginatedList

update(**kwargs) None

Update information on the package. Note that many fields may be unalterable by the API key holder.

Calls:

“PUT /packages/{id}” <https://fabman.io/api/v1/documentation#/packages/putPackagesId>

Returns:

None – attributes are updated in place

Return type:

None

PackageCredit

class fabman.package.PackageCredit(requester: Requester, attributes: dict)

Simple Class to handle PackageCredits

Initialize the Object. Stores the requester method to interact with the API for further calls

Parameters:
  • requester (Requester) – The Requester object to make requests with

  • attributes (dict) – The attributes to initialize this object with

delete(**kwargs) Response

Deletes a credit from a package. WARNING: This is irreversible.

Calls:

“DELETE /packages/{packageId}/credits/{creditId}” <https://fabman.io/api/v1/documentation#/packages/deletePackagesIdCreditsCreditid>

Returns:

response information of call

Return type:

requests.Response

update(**kwargs) None

Updates the credit. Attributes are updated in place with new information.

Calls:

“PUT /packages/{packageId}/credits/{creditId}” <https://fabman.io/api/v1/documentation#/packages/putPackagesIdCreditsCreditid>

Returns:

None – attributes are updated in place

Return type:

None

PackagePermission

class fabman.package.PackagePermission(requester: Requester, attributes: dict)

Simple Class to handle PackagePermissions

Initialize the Object. Stores the requester method to interact with the API for further calls

Parameters:
  • requester (Requester) – The Requester object to make requests with

  • attributes (dict) – The attributes to initialize this object with

delete(**kwargs) Response

Deletes a permission from a package. WARNING: This is irreversible.

Calls:

“DELETE /packages/{packageId}/permissions/{permissionId}” <https://fabman.io/api/v1/documentation#/packages/deletePackagesIdPermissionsPermissionid>

Returns:

response information of call

Return type:

requests.Response

update(**kwargs) None

Updates the permission. Attributes are updated in place with new information.

Calls:

“PUT /packages/{packageId}/permissions/{permissionId}” <https://fabman.io/api/v1/documentation#/packages/putPackagesIdPermissionsPermissionid>

Returns:

None – attributes are updated in place

Return type:

None