Get Dataiku Projects with Tag "Foo"

Thiagarajan
Thiagarajan Registered Posts: 8 ✭✭

Do we have a mechanism to retrieve list of projects within our Dataiku instance that has certain specific tags?

Thanks!

Best Answer

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,993 Neuron
    Answer ✓

    I am not aware of an API that can filter projects by tag so you will need to get all of the tags for all of the projects first and then filter that. You can add this line to your code to collect all the project tags into a single list:

    project_tags = list(proj.get_tags()['tags'].keys())
    

    To do this in the GUI you can navigate to Projects (/project-list/) and use the Tags filter drop down.

Answers

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,993 Neuron
    edited September 24

    As a built in method or do you want to use the Dataiku Python API?

  • Thiagarajan
    Thiagarajan Registered Posts: 8 ✭✭

    Dataiku Python API should work @Turribeach .

    The docs I had found so far helps us to retrieve projects but not projects with certain tags. So curious to hear if there's a way to filter projects by tags.

    import dataiku, json
    from dataiku import pandasutils as pdu
    import pandas as pd client = dataiku.api_client()
    projects = client.list_projects()
    df = pd.DataFrame(columns=['project', 'dataset'])
    for p in projects :
    proj = client.get_project(p["projectKey"])
    datasets = []
    all_datasets = proj.list_datasets()
    for dataset in all_datasets:
    df = df.append({'project': p["projectKey"], 'dataset': dataset.name}, ignore_index=True)
    df = df.drop_duplicates()
    print(df)

Setup Info
    Tags
      Help me…