Skip to main content

shotgun_extensions extends the functionality of shotgun_api3 Python package

Project description

shotgun_extensions

shotgun_extensions extends the functionality of shotgun_api3 Python package.

Quick example:

>> > from shotgun_api3 import Shotgun
>> > from shotgun_extensions import sge_find_one
>> > sg = Shotgun('https://your-server.com', script_name='Script Name', api_key='scrip_api_key')
>> > my_shot = sge_find_one(sg, entity_type='Shot',
                            filters=[['code', 'is', '101_001_0001']],
                            fields=['name', 'query_field'])
>> > print(my_shot)

[{'name': '101_001_0001', 'query_field': 'value'}]

Supported Features

Query Fields

Currently, the ShotGun API does not support requesting query field values in the response from methods such as find and find_one.

In order to get these values, you must request the entity schema and parse the response to generate additional queries to the API.

See https://community.shotgridsoftware.com/t/api-to-get-query-field-values/11263 for details.

The query_fields module provides two methods that are meant to replace the find and find_one methods from the shotgun_api3 package:

  • sge_find
  • sge_find_one

There is an optional parameter you can use with these functions called "logged_in_user." This is for you to pass a user entity that will be used whenever you are referencing "Me" in one of your query fields in ShotGun.

The expected format is as follows:

{
    'type': 'HumanUser',
    'id': 1234
}

Install

You need Python 3.7 or newer.

You can install the library like this (preferably in a virtualenv):

pip install shotgun-extensions

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shotgun_extensions-1.0.5.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

shotgun_extensions-1.0.5-py3-none-any.whl (7.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page