select files with regex on project level

Options
Sarthak
Sarthak Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 15 ✭✭✭

Hi,

How to create a list of datasets matching a keyword using python API? Need to know this as a part of some project.

Regards

Best Answer

  • Zach
    Zach Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 153 Dataiker
    Answer ✓
    Options

    Hi @s_dravid
    ,

    The following code will list all datasets in the flow where the name of the dataset contains the word "KEYWORD":

    import dataikuimport dataikuapiclient = dataiku.api_client()project = client.get_default_project()flow = project.get_flow()graph = flow.get_graph()for item in graph.get_items_in_traversal_order(as_type="object"):if not isinstance(item, dataikuapi.dss.dataset.DSSDataset):# Skip items that aren't a datasetcontinueif "KEYWORD" in item.name:print("Found dataset with keyword:", item.name)

    Thanks,

    Zach

Answers

Setup Info
    Tags
      Help me…