neurodata / neuroparc

Other
165 stars 43 forks source link

Could we please add to the scripts folder.... #28

Open dPys opened 4 years ago

dPys commented 4 years ago

Users are going to want a set of simple API's for saving and retrieving all kinds of metadata from the .json. Otherwise, folks might not catch on?

dPys commented 4 years ago

And maybe start by building off of this:

def seek_keys(d, key_list):
    for k, v in d.items():
        if k in key_list:
            if isinstance(v, dict):
                print(list(v.keys())[0])
            else:
                print(str(v))
        if isinstance(v, dict):
            seek_keys(v, key_list)

seek_keys(json_dict, ['label'])
seek_keys(json_dict, ['center'])