Datasaur
Search…
Script Usage for Project Creation via API
Script Usage to Create Project via API in Project Creation Wizard (PCW)

Usage Requirement

This feature will only work in a team workspace. If you are already inside the team workspace, it would look like this. Team workspace has a sidebar that contains analytics, activity, projects, members, custom script, and settings page.

Script Usage Instruction

1. Generate your OAuth credentials

The instructions can be found here. Save the credentials securely, we will use it for the next step.

2. Set up a project via Custom Project

We have five steps here. Set up your project until reaching Step 5 (Project Settings).

3. In the Step 5, click “View Script” in the top right corner

4. Copy the script

5. Set up your project requirement file to create a project via API

api_client.zip
7KB
Binary
api_client.zip
We provide a sample python project to create the project via API. Here's how the project structure sample will look like:
1
root/
2
|- src/
3
|- documents/
4
|- api_client.py
5
|- project_configuration.json
6
|- readme.md
Copied!

6. Open project_configuration.json file

Replace project_configuration.json file content with the script that you have copied from PCW.

7. Insert your dataset for the project in the documents folder

You need to remove existing files that doesn't belong to the project.

8. Open terminal in the example python script root directory

9. Install the dependencies

1
# Install dependencies
2
python -m pip install -r src/requirements.txt
Copied!

10. Run this command on your terminal to create the project

1
# Create project
2
python api_client.py create_project \
3
--base_url https://datasaur.ai \
4
--client_id YOUR_CLIENT_ID \
5
--client_secret YOUR_CLIENT_SECRET \
6
--team_id YOUR_TEAM_ID
7
8
# for windows replace \ with ^
Copied!

11. Run this command to track your project creation status

The job_id will be given at Step 10.
1
# Get job status
2
# You will get JOB_ID from create project step above
3
python api_client.py get_job_status \
4
--base_url https://datasaur.ai \
5
--client_id YOUR_CLIENT_ID \
6
--client_secret YOUR_CLIENT_SECRET \
7
--job_id YOUR_JOB_ID
8
9
# for windows replace \ with ^
Copied!
With these instructions, you can successfully create a new project by using a script via API.
Notes: For the token-based project, we don't bring up the label set inside the API. You will need to upload in label set extension here.
Last modified 3mo ago