Skip to main content
Answer

How to use TimestampRange when listing Events

  • April 28, 2025
  • 1 reply
  • 30 views

Anders Brakestad
Seasoned

Hello,

I notice from the Events API documentation that the start_time can be specified by a TimestampRange object. However, the documentation does not explain what this object is, whether it is a class external to the Cognite SDK, or give any examples on how to use it.

Can someone give more information?

-Anders

Best answer by Ben Petree

Hey Anders,

Here is a link to the object definition:

https://github.com/cognitedata/cognite-sdk-python/blob/master/cognite/client/data_classes/shared.py#L14

and this is how you would import it:

from cognite.client.data_classes import TimestampRange

Our docs are also in the same repo:

https://github.com/cognitedata/cognite-sdk-python/tree/master/docs

It looks like none of the shared data_classes are shown in the docs. I’ll look into what it takes to build these out a little more. This sdk is open source so if you want to contribute check out this page:

https://github.com/cognitedata/cognite-sdk-python/blob/master/CONTRIBUTING.md

1 reply

Ben Petree
Seasoned Practitioner
Forum|alt.badge.img+4
  • Seasoned Practitioner
  • Answer
  • April 28, 2025

Hey Anders,

Here is a link to the object definition:

https://github.com/cognitedata/cognite-sdk-python/blob/master/cognite/client/data_classes/shared.py#L14

and this is how you would import it:

from cognite.client.data_classes import TimestampRange

Our docs are also in the same repo:

https://github.com/cognitedata/cognite-sdk-python/tree/master/docs

It looks like none of the shared data_classes are shown in the docs. I’ll look into what it takes to build these out a little more. This sdk is open source so if you want to contribute check out this page:

https://github.com/cognitedata/cognite-sdk-python/blob/master/CONTRIBUTING.md