class milkstraw_client.generated_data.GeneratedData(id: str, model: str, status: str)[source]

Bases: object

Handles interactions with generated data backend APIs.

This class provides methods to generate, retrieve, and list generated data, as well as download generated data and associated reports.

id

The unique identifier of the generated data.

Type:

str

model

The ID of the model used to generate the data.

Type:

str

status

The status of the generated data.

Type:

str

static download(id: str, file_path: str) str[source]

Download the content of generated data by its unique identifier.

Parameters:
  • id (str) – The unique identifier of the generated data.

  • file_path (str) – The path to save the downloaded file.

Returns:

The path to the downloaded file.

Return type:

str

static download_report(id: str, file_path: str) str[source]

Download the report associated with generated data.

Parameters:
  • id (str) – The unique identifier of the generated data.

  • file_path (str) – The path to save the downloaded report file.

Returns:

The path to the downloaded report file.

Return type:

str

static generate(model: str, records_num: int, condition: dict | None = None) GeneratedData[source]

Generate synthetic data using a trained model.

Parameters:
  • model (str) – The ID of the model used for data generation.

  • records_num (int) – The number of records to generate.

  • condition (dict, optional) – A dictionary specifying the generation condition. Defaults to None.

Returns:

An instance of the GeneratedData class representing the generated data.

Return type:

GeneratedData

static get(id: str) GeneratedData[source]

Retrieve generated data by its unique identifier.

Parameters:

id (str) – The unique identifier of the generated data.

Returns:

An instance of the GeneratedData class representing the retrieved generated data.

Return type:

GeneratedData

static list() list[milkstraw_client.generated_data.GeneratedData][source]

List all available generated data.

Returns:

A list of GeneratedData instances representing the available generated data.

Return type:

list[GeneratedData]