Python Script Example
An example script to create a project via API by utilizing Project Creation Wizard (PCW)
- pip3 and python3 CLI installed on the machine.
- 1.
- 2.Run
pip3 install -r requirements.txt
.
The instructions can be found here. Save the credentials securely, we will use it for the next step.
We have five steps here. Set up your project until reaching Step 5 (Project Settings). Make sure all the configuration that you want for the project is set properly.

Figure 1: Step 5 of Project Creation Wizard Default UI
4. Copy the configuration by clicking the icon on the top right corner of the UI
.png?alt=media)
Figure 2: Step 5 of Project Creation Wizard View Script
The file is located on the
api-client-example/create-project-async
folder.All files inside the folder will be treated as the project's documents. Make sure you remove any files that doesn't belong to the project.
Navigate to
api-client-example/create-project-async
first before running the command. Note that this API only submit a job, not a synchronous process. Thus, we need to make sure whether the job is successful which will be covered in the next step.python3 api_client.py create_project \
--base_url https://app.datasaur.ai \
--client_id YOUR_CLIENT_ID \
--client_secret YOUR_CLIENT_SECRET \
--team_id YOUR_TEAM_ID
# for windows replace \ with ^
The
job_id
will be given at the previous step along with the full command as the response. The detailed of this API could be seen here.python3 api_client.py get_job_status \
--base_url https://app.datasaur.ai \
--client_id YOUR_CLIENT_ID \
--client_secret YOUR_CLIENT_SECRET \
--job_id YOUR_JOB_ID
# for windows replace \ with ^
With these instructions, you can successfully create a new project by using a Python script via API.
Last modified 17d ago