Export

class previsionio.export.Export(_id, exporter_id: str, dataset_id: str = None, prediction_id: str = None, status: str = None, **kwargs)

Bases: previsionio.api_resource.ApiResource, previsionio.api_resource.UniqueResourceMixin

An export

Parameters:
  • _id (str) – Unique id of the export
  • exporter_id (str) – Unique exporter id on which to create the export
  • dataset_id (str, optional) – Unique dataset id on which to create the export
  • prediction_id (str, optional) – Unique prediction id on which to create the export
classmethod export_dataset(exporter_id, dataset: previsionio.dataset.Dataset, wait_for_export: bool = False)

Upload a Dataset from the current active project using an exporter.

Parameters:
  • exporter_id (str) – Unique exporter id on which to create the export
  • dataset (Dataset) – Dataset to upload
  • wait_for_export (bool, optional) – Wether to wait until the export is complete or not
Returns:

The registered export object

Return type:

Export

classmethod export_file(exporter_id: str, file_path: str, encoding: str = None, separator: str = None, decimal: str = None, thousands: str = None, wait_for_export: bool = False, **kwargs)

Upload a CSV file using an exporter.

Parameters:
  • exporter_id (str) – Unique exporter id on which to create the export
  • file_path (str) – Path of the file to upload
  • encoding (str, optional) – Encoding of the file to upload
  • separator (str, optional) – Separator of the file to upload
  • decimal (str, optional) – Decimal of the file to upload
  • thousands (str, optional) – Thousands of the file to upload
  • wait_for_export (bool, optional) – Wether to wait until the export is complete or not
Returns:

The registered export object

Return type:

Export

classmethod export_prediction(exporter_id, prediction: Union[previsionio.prediction.DeploymentPrediction, previsionio.prediction.ValidationPrediction], wait_for_export: bool = False)

Upload a DeploymentPrediction or a ValidationPrediction from the current active project using an exporter.

Parameters:
  • exporter_id (str) – Unique exporter id on which to create the export
  • prediction (DeploymentPrediction`|:class:.ValidationPrediction`) – Prediction to upload
  • wait_for_export (bool, optional) – Wether to wait until the export is complete or not
Returns:

The registered export object

Return type:

Export

classmethod from_id(_id: str)

Get an export from the instance by its unique id.

Parameters:_id (str) – Unique id of the export to retrieve
Returns:The fetched export
Return type:Export
Raises:PrevisionException – Any error while fetching data from the platform or parsing the result
classmethod list(exporter_id: str)

List all the available exports given an exporter id.

Parameters:exporter_id – exporter id
Returns:The fetched export objects
Return type:list(Export)