Export (risksense_api.__subject.__exports.__exports
)¶
Exports module defined for different export related api endpoints.
- class risksense_api.__subject.__exports.__exports.ExportFileType[source]¶
Bases:
object
ExportFileType class and params
- CSV = 'CSV'¶
- XML = 'XML'¶
- XLSX = 'XLSX'¶
- JSON = 'JSON'¶
- class risksense_api.__subject.__exports.__exports.ExportRowNumbers[source]¶
Bases:
object
ExportRowNumbers class and params
- ROW_5000 = '5000'¶
- ROW_10000 = '10000'¶
- ROW_25000 = '25000'¶
- ROW_50000 = '50000'¶
- ROW_100000 = '100000'¶
- ROW_ALL = 'All'¶
- class risksense_api.__subject.__exports.__exports.Exports(profile)[source]¶
Bases:
Subject
Class for Exports function defintions.
To utlise exports function:
- Parameters:
profile (
object
) – Profile Object
- Usage:
self.{risksenseobjectname}.exports.{function}
Examples
To download an export using
download_export()
function>>> self.{risksenseobject}.exports.download_export(123,'test.csv')
- __init__(profile)[source]¶
Initialization of Exports object.
- Parameters:
profile (
object
) – Profile Object
- check_status(export_id, client_id=None)[source]¶
Checks on the status of an export.
- Parameters:
export_id (
int
) – The ID of the export to be checked.client_id (
typing.Optional
[str
]) – Client ID. If an ID isn’t passed, will use the profile’s default Client ID.
- Return type:
str
- Returns:
A string reflecting the status of the export is returned.
Example
To check status of export id 123
>>> self.{risksenseobject}.export.check_status(123)
- download_export(export_id, filename, client_id=None)[source]¶
Download an exported file.
- Parameters:
export_id (
int
) – The ID of the export.filename (
str
) – The filename to save the downloaded file as.client_id (
typing.Optional
[int
]) – Client ID. If an ID isn’t passed, will use the profile’s default Client ID.
- Return type:
bool
- Returns:
True/False reflects whether or not the download was successful.
Example
To download an export file
>>> self.{risksenseobject}.export.download_export(123,'test.csv')
- delete_files(export_id, client_id=None)[source]¶
Delete export job.
- Parameters:
export_id (
int
) – The export ID.client_id (
typing.Optional
[int
]) – Client ID. If an ID isn’t passed, will use the profile’s default Client ID.
- Return type:
bool
- Returns:
True/False reflecting whether or not the file deletion was successful.
Example
To delete an export job
>>> self.{risksenseobject}.export.delete_files(123)