# Python - Sequence attributes in Flame 2022

**URL:** <https://forum.logik.tv/t/python-sequence-attributes-in-flame-2022/8903>\
**Category:** Python\
**Tags:** sequence\
**Created:** [August 2, 2023, 2:49pm UTC](https://forum.logik.tv/t/python-sequence-attributes-in-flame-2022/8903 "2023-08-02T14:49:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thoma](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@Thoma](https://forum.logik.tv/u/Thoma)\
**Post date:** [August 2, 2023, 2:49pm UTC](https://forum.logik.tv/t/python-sequence-attributes-in-flame-2022/8903/1 "2023-08-02T14:49:27Z")

</div>

I’m trying to get the timecode values for ‘Media Start’, ‘Media End’, and ‘Media Duration’ of a sequence with python (2022.2). The sequence attribute ‘start\_time’ seems to correspond to ‘Media\_start’ in the media panel but there’s no ‘end\_time’ or somesuch that corresponds to the ‘Media\_End’. The ‘duration’ attribute is actually ‘In/out Duration’ and there doesn’t seem to be one for ‘Media Duration’ either.

Am I missing something or are the sequence attributes really this incomplete and/or inconsistent with their tokens in the media panel?

---

<div class="post-metadata">

**Author:** ![fredwarren](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.logik.tv/fredwarren/32/158_2.png) [@fredwarren](https://forum.logik.tv/u/fredwarren)\
**Post date:** [August 2, 2023, 5:25pm UTC](https://forum.logik.tv/t/python-sequence-attributes-in-flame-2022/8903/2 "2023-08-02T17:25:57Z")

</div>

You are right that it is not possible to do so out of the box right now. Please submit an Improvement request at [flamefeedback.autodesk.com](http://flamefeedback.autodesk.com) for it.

In the meantime, you could use on of these two methods:

**via in/out mark removal**

```auto
def getClipEndTime( clip ):
    inmark = clip.in_mark.get_value()
    outmark = clip.out_mark.get_value()
    clip.in_mark = None
    clip.out_mark = None
    duration = clip.duration
    clip.in_mark = inmark
    clip.out_mark = outmark
    return clip.start_time.get_value() + duration

```

**via segments start/end**

```auto
def getClipEndTime( clip ):
    if len(clip.versions) > 0 :
        track = clip.versions[0].tracks[0]
    else:
        track = clip.audio_tracks[0].channels[0]
    return track.segments[-1].record_out + 1
        def getClipFullDuration( clip ):
    return getClipEndTime( clip ) - clip.start_time.get_value()

```

---

<div class="post-metadata">

**Author:** ![Thoma](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@Thoma](https://forum.logik.tv/u/Thoma)\
**Post date:** [August 2, 2023, 9:21pm UTC](https://forum.logik.tv/t/python-sequence-attributes-in-flame-2022/8903/3 "2023-08-02T21:21:49Z")

</div>

Ah - interesting. Thanks for the help, Fred!
