Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hi,
I am trying to export a project using a dataiku python REST API and I would like to specifying the location in which to store the project I.E. a specified path on our server that hosts Dataiku. Please see the below:
for project_name in list_of_project_keys:
project = client.get_project(project_name)
project.export_to_file(project_name + '.zip')
On the last line, I'd like to specify the location in which to export the project to - any advise would be appreciated.
Operating system used: Linux
Hi @harpreet96 and @ArvinUbhi ,
The export_to_file() allows you to specify a full filepath, such as /my/dir/project.zip
The following example will export your projects to the directory specified by the BASE_DIR variable, eg /path/to/dir/PROJECT_NAME.zip
import os.path
BASE_DIR = '/path/to/dir'
for project_name in list_of_project_keys:
project = client.get_project(project_name)
export_path = os.path.join(BASE_DIR, project_name + '.zip')
project.export_to_file(export_path)
The directory must already exist.
Thanks,
Zach
Great question harpreet! Id also like to know the answer to this one - would really benefit my teams maintenance of our DSS envs.
Ill keep posted on this one!😁
Hi @harpreet96 and @ArvinUbhi ,
The export_to_file() allows you to specify a full filepath, such as /my/dir/project.zip
The following example will export your projects to the directory specified by the BASE_DIR variable, eg /path/to/dir/PROJECT_NAME.zip
import os.path
BASE_DIR = '/path/to/dir'
for project_name in list_of_project_keys:
project = client.get_project(project_name)
export_path = os.path.join(BASE_DIR, project_name + '.zip')
project.export_to_file(export_path)
The directory must already exist.
Thanks,
Zach