Programmatically set default code environment for a project

michellepace
michellepace Registered Posts: 1

Hello,

I am programmatically creating projects and would also like to programmatically set the default code environment for each project. The first screenshot below shows how to do this per project manually. I have looked in the API for the project object but cannot find any way to do this. I am hoping the documentation is perhaps just out of date. Does anyone perhaps know how to do this?

Thanks in advance, Michelle

Operating system used: Windows


Operating system used: Windows

Tagged:

Answers

  • FlorentD
    FlorentD Dataiker, Dataiku DSS Core Designer, Registered Posts: 25 Dataiker
    edited July 17

    Hi Michelle,

    You can create code env by using

    import dataiku
    
    
    client = dataiku.api_client()
    
    client.create_code_env(...)

    The documentation for creating a code env is here.

    Then you can set the default code env by using:

    project = dataiku.get_projct("PROJECT_KEY)
    
    settings = project.get_settings().get_raw()
    
    # modify the code env section
    
    settings.save()
    
    

    Hope this help and answer your question

    Best

Setup Info
    Tags
      Help me…