# RV Cookbook - How to get things done with RV in Python

**URL:** <https://community.shotgridsoftware.com/t/rv-cookbook-how-to-get-things-done-with-rv-in-python/18820>\
**Category:** RV\
**Tags:** rvio, rv-package, rv\
**Created:** [May 22, 2024, 10:19pm UTC](https://community.shotgridsoftware.com/t/rv-cookbook-how-to-get-things-done-with-rv-in-python/18820 "2024-05-22T22:19:36Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![patrickwolf](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/patrickwolf/32/3931_2.png) [@patrickwolf](https://community.shotgridsoftware.com/u/patrickwolf)\
**Post date:** [May 24, 2024, 1:00pm UTC](https://community.shotgridsoftware.com/t/rv-cookbook-how-to-get-things-done-with-rv-in-python/18820/15 "2024-05-24T13:00:07Z")

</div>

Accessing SG Tracking Info for a given source

> [@RV Screening Room read version data](https://community.shotgridsoftware.com/t/rv-screening-room-read-version-data/3276/9):
>
> ```auto
> def _get_source_shotgun_data(source):
> """
> Get the shotgun data from a source.
> 
> Args:
> source (str): rv source name.
> 
> Returns:
> dict: shotgun data as a dictionary.
> 
> """
> try:
> source_data = rv.commands.getStringProperty(
> "{}.tracking.info".format(source)
> )
> 
> data_list = ast.literal_eval(str(source_data))
> except:
> return {}
> 
> return {k: v for k, v in zip(data_list, data_list[1:])}
> 
> ```

It’s important to wait until the tracking info is populated though

> [@How to get SG entity data using shotgun\_fields.mu](https://community.shotgridsoftware.com/t/how-to-get-sg-entity-data-using-shotgun-fields-mu/3378/2):
>
> As far as the fields for the `track.info` on each source, they aren’t created immediately. They are created asynchronously slightly after the source is created. If you are trying to access them on source-group-complete, it will be too soon for the API query to have filled out the data. Instead, watch for `graph-state-change` where `tracking.info` is in the event.contents().

---

_[View the full topic](https://community.shotgridsoftware.com/t/rv-cookbook-how-to-get-things-done-with-rv-in-python/18820)._
