Skip to content

Instantly share code, notes, and snippets.

@MitchellKehn
Created December 23, 2020 06:50
Show Gist options
  • Save MitchellKehn/67c18c249b4f87f47d6549602be30e4f to your computer and use it in GitHub Desktop.
Save MitchellKehn/67c18c249b4f87f47d6549602be30e4f to your computer and use it in GitHub Desktop.
[get publish descriptions by user] #shotgun
from altpipe.shotgun.api import getShotgunConnection
from pprint import pprint
sg = getShotgunConnection()
user = sg.find_one("HumanUser", [["login", "is", "jtrudgian"]])
versions = sg.find("Version", [["user", "is", user]], ["description"], limit=1000)
descriptions = []
for version in versions:
descriptions.append(version["description"])
descriptions = sorted(descriptions, reverse=True, key=lambda x: len(x) if x else None)
for i in descriptions:
print i
print
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment