Projects
Learn to use and manage projects that allow you to store and collaborate on data.
Last updated
Was this helpful?
Learn to use and manage projects that allow you to store and collaborate on data.
Last updated
Was this helpful?
Gretel Projects can be thought of as repositories that hold models. Projects are created by single users and can be shared with various permissions:
Read: Users may access data artifacts (such as synthetic data and reports)
Write: Users may create and run models.
Administrator: Users may add other users to a project.
Owner: Full control.
The most important thing to note about Projects is that the name
attribute of a project is globally unique. If you are familiar with services like Simple Storage Service (S3), then Project naming will feel very similar since S3 bucket names are also globally unique within a specific service provider (such as AWS).
Projects have the following attributes you should be familiar with:
name
: A globally unique name for the project. When you create a project without specifying a specific name, Gretel will generate one for you. This will be a randomized name based on your username
and a unique hash slug. If you specify a name
that is already used, Project creation will fail.
display_name
: This can be any descriptive name for the Project that will control how the Project is listed and displayed in the Gretel Console. It is non-unique.
description
: This optional field can be provided to provide a user-friendly description of the Project.
The Gretel Python SDK gives more flexibility and control around Project management. Within the SDK, the should be the primary orientation point for doing most of your work with Gretel.
The SDK differs in that when creating or accessing Projects, you will be given an instance of a Project class that you can interact with. Let's take a look.
You can create a project with no input attributes:
Alternatively, you can provide Project attributes to the create_project()
method:
As mentioned earlier, Project names are globally unique. However, we have created a utility in the SDK that allows users to "share" identical project names such that any user could have their own version of a project called "test" or "foo".
This helper will either create a new project or fetch an existing one, giving you back a Project instance. Additionally, the display name of the project will automatically be set for you based on the name you provide. Let's take a look:
In this mode, every user could use the exact my-new-awesome-project
string and a unique slug for that user will be appended to the Project name. This may be especially useful if you are re-running Notebooks or routines and do not want to use a combination of create_project()
and get_project()
to determine if a project already exists or not.
In certain occasions, you may want to create a Project only for the purposes of creating a model and extracting the specific outputs (Synthetic Data, Synthetic Quality Report, etc). Once you have extracted the data you need, you can delete the Project, which will then delete all of the models and artifacts related to those models.
For this use case, there is a temporary project context manager you can use. Once the context handler exits, the Project will be deleted:
If you already have a Gretel Project, in order to run model operations, you will need to load an instance of the Project class in the SDK. We'll use our example Project from above: my-awesome-project
to show how to do this.
To delete a project from the SDK, you utilize the delete()
method on a Project instance:
Once you delete a project, the class instance is not usable anymore. If you try and do any meaningful operation with it, you'll receive a GretelProjectError
such as:
GretelProjectError: Cannot call method. The project has been marked for deletion.