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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file shotgun_extensions-1.0.5.tar.gz.

File metadata

  • Download URL: shotgun_extensions-1.0.5.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.7

File hashes

Hashes for shotgun_extensions-1.0.5.tar.gz
Algorithm Hash digest
SHA256 46e3be18f23ba1c9eea501afae62954d98dab3c650aae3a5a739297ababab601
MD5 8090bef94e5319f5c20d7ea42e94e79c
BLAKE2b-256 609ffcedd111e6498dbc9c501865d349a8d4ee4249746f55a887a925b630d8ff

See more details on using hashes here.

File details

Details for the file shotgun_extensions-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for shotgun_extensions-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ad3310a60636b4ca8fe2cdaf7292737c84be98f41f1d6a6d20078d373effa583
MD5 9da3d11c6a0b6ca37dca64b161345818
BLAKE2b-256 3cee2eb9fbcdb0276c6242b47679144fe63d71ed6f1ab0e561cc9409af6f7982

See more details on using hashes here.

Supported by

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