# How to get attribute keys from a node?

**URL:** https://forum.atmospherictoolbox.org/t/how-to-get-attribute-keys-from-a-node/937
**Category:** CODA
**Created:** [February 23, 2026, 11:14am UTC](https://forum.atmospherictoolbox.org/t/how-to-get-attribute-keys-from-a-node/937 "2026-02-23T11:14:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Steven\_Compernolle](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/steven_compernolle/32/91_2.png) [@Steven\_Compernolle](https://forum.atmospherictoolbox.org/u/Steven_Compernolle)
#### Post date: [February 23, 2026, 11:14am UTC](https://forum.atmospherictoolbox.org/t/how-to-get-attribute-keys-from-a-node/937/1 "2026-02-23T11:14:03Z")

</div>

Is there a function that lists the attribute keys of a node?

[`coda.get_field_names`](https://stcorp.github.io/coda/doc/html/python/index.html#coda_get_field_names)

gives the node names below that node, but not the attributes.

[`coda.get_attributes`](https://stcorp.github.io/coda/doc/html/python/index.html#coda_get_attributes)

seems to give the attribute values on the node, but not the attribute keys.

---

<div class="post-metadata">

### Author: ![sander.niemeijer](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/sander.niemeijer/32/5_2.png) [@sander.niemeijer](https://forum.atmospherictoolbox.org/u/sander.niemeijer)
#### Post date: [February 23, 2026, 12:01pm UTC](https://forum.atmospherictoolbox.org/t/how-to-get-attribute-keys-from-a-node/937/2 "2026-02-23T12:01:01Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![sander.niemeijer](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/sander.niemeijer/32/5_2.png) [@sander.niemeijer](https://forum.atmospherictoolbox.org/u/sander.niemeijer)
#### Post date: [February 23, 2026, 12:04pm UTC](https://forum.atmospherictoolbox.org/t/how-to-get-attribute-keys-from-a-node/937/3 "2026-02-23T12:04:16Z")

</div>

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:

```auto

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.

---

<div class="post-metadata">

### Author: ![Steven\_Compernolle](https://forum.atmospherictoolbox.org/user_avatar/forum.atmospherictoolbox.org/steven_compernolle/32/91_2.png) [@Steven\_Compernolle](https://forum.atmospherictoolbox.org/u/Steven_Compernolle)
#### Post date: [February 23, 2026, 2:22pm UTC](https://forum.atmospherictoolbox.org/t/how-to-get-attribute-keys-from-a-node/937/4 "2026-02-23T14:22:19Z")

</div>

Thanks! I used list() on the returned record which gave me only the values. vars works fine.
