Submit your inspiring success story or innovative use case to the 2022 Dataiku Frontrunner Awards! ENTER YOUR SUBMISSION

ProjectId in parameter python script

Solved!
Patrik
Level 1
ProjectId in parameter python script

Hi,

I am trying to develop macro for projects which can read project related resources.

How can I inside the python script in do function: 

def do(payload, config, plugin_config, inputs):

 get projectId where from is the macro running?


Operating system used: Linux

0 Kudos
1 Solution
HarizoR
Dataiker
Dataiker

Hi Patrik,

The get_default_project() method of the dataikuapi.DSSClient class can help you:

import dataiku
client = dataiku.api_client()
current_project_key = client.get_default_project().project_key

 

Best,

Harizo

 

View solution in original post

1 Reply
HarizoR
Dataiker
Dataiker

Hi Patrik,

The get_default_project() method of the dataikuapi.DSSClient class can help you:

import dataiku
client = dataiku.api_client()
current_project_key = client.get_default_project().project_key

 

Best,

Harizo

 

Labels

?
Labels (2)

Setup info

?
A banner prompting to get Dataiku