Projects SDK

You may use the Projects SDK to programmatically interact with Gretel APIs using a familiar python interface.

The example below ties together a number of concepts to train a synthetic model and then generate data from the model.

import pandas as pd

from gretel_client import create_project, poll

project = create_project()

# create a synthetic model using a default synthetic config from
#   Providing a data_source will override the datasource from the template. If the data source is a local
#   file, then it will automatically be uploaded to Gretel Cloud as part of the submission step
model = project.create_model_obj(

# submit the model to Gretel Cloud for training

# wait for the model to training

# read out a preview data from the synthetic model
pd.read_csv(model.get_artifact_link("data_preview"), compression="gzip")

Module Reference