ProjectId in parameter python script

Solved!
Patrik
Level 2
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
Developer Advocate

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
Developer Advocate

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