Reading Tags of datasets in python

Options
SuhasChinku
SuhasChinku Registered Posts: 5 ✭✭✭✭

Hi all,

I am looking for a way to list all the dataset names based on the "Tags" into a python code.

So that I can get the dataset names which can be used for further processing. Thank you

Regards

Suhas

Tagged:

Answers

  • Sergey
    Sergey Dataiker, Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS Core Concepts Posts: 365 Dataiker
    edited July 17
    Options

    Hi @SuhasChinku

    You should be able to do this via this code sample (replace the <> placeholders with proper value):

    import dataiku
    
    client = dataiku.api_client()
    project = client.get_project('<project_key>')
    
    datasets = project.list_datasets()
    
    for dataset in datasets:
        if ('<tag>' in dataset['tags']):
            print(dataset['name'])
Setup Info
    Tags
      Help me…