Is there a function that lists the attribute keys of a node?
gives the node names below that node, but not the attributes.
seems to give the attribute values on the node, but not the attribute keys.
Is there a function that lists the attribute keys of a node?
gives the node names below that node, but not the attributes.
seems to give the attribute values on the node, but not the attribute keys.
The result of coda.get_attributes is actually a coda.Record that contains both the attribute keys and values. It has a __dict__ property that allows you to do things such as vars(coda.get_attributes(...)) to get the content as a dict, and vars(coda.get_attributes(...)).keys() to get the attribute keys.
Note that if you only want the attribute names without actually reading the attribute values you would have to use some of the lower level routines such as:
cursor = coda.Cursor(...)
coda.cursor_goto_attributes(cursor)
coda.get_field_names(cursor)
Depending on whether you are already using a coda.Cursor or not, this might be easier.
Thanks! I used list() on the returned record which gave me only the values. vars works fine.