# Variables in header

**URL:** <https://discourse.obspy.org/t/variables-in-header/858>\
**Category:** Users Mailing List Archive\
**Tags:** archive\
**Created:** [December 2, 2019, 11:40am UTC](https://discourse.obspy.org/t/variables-in-header/858 "2019-12-02T11:40:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reza\_Rezaei](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/r/74df32/32.png) [@Reza\_Rezaei](https://discourse.obspy.org/u/Reza_Rezaei)\
**Post date:** [December 2, 2019, 11:40am UTC](https://discourse.obspy.org/t/variables-in-header/858/1 "2019-12-02T11:40:27Z")

</div>

Hello every one,

In SAC, we can write couple of variables in the header (T0~T10). Is there any similar approach to write and retrieve variables in Stream or Trace?

Best regards,  
Reza

---

<div class="post-metadata">

**Author:** ![Jonathan\_K\_Maccarthy](https://discourse.obspy.org/user_avatar/discourse.obspy.org/jonathan_k_maccarthy/32/266_2.png) [@Jonathan\_K\_Maccarthy](https://discourse.obspy.org/u/Jonathan_K_Maccarthy)\
**Post date:** [December 3, 2019, 3:10pm UTC](https://discourse.obspy.org/t/variables-in-header/858/2 "2019-12-03T15:10:43Z")

</div>

Hi Reza,

Trace objects have a .meta attribute that is essentially just a dictionary, and can hold any keys and values you add to it. Just be careful not to overwrite the core keys, like ‘starttime’, ‘sampling\_rate’, etc.

Best,  
Jon
