Skip to main content

Pythonic Shotgrid API wrapper

Project description

shotgrid

This is an object-oriented wrapper around the shotun api3 Python API, that includes classes for each shotgrid entity type with convenience methods.

Installation

The easiest way to install:

$ pip install shotgrid

Alternatively, use distman to dist to a deployment area using options defined in the dist.json:

$ distman [-d]

Files and directories can be distributed from any folder or git repo containing a dist.json file.

Configuration

Default settings are stored in an env stack .env file. They can be stored in the default stack, or in a namespaced shotgrid.env stack file to keep settings separate.

Start by renaming or copying the example_shotgrid.env file:

$ cp example_shotgrid.env shotgrid.env

and editing it's contents with the appropriate values:

LOG_LEVEL: INFO
SG_SCRIPT_URL: https://example.shotgunstudio.com
SG_SCRIPT_NAME: script_name
SG_SCRIPT_KEY: XXXXXX

Usage

Basic usage:

>>> from shotgrid import Shotgrid
>>> sg = Shotun()
>>> show = sg.get_projects("Demo: Animation")[0]
>>> shot = show.get_shots("bunny_080_0200")[0]
>>> tasks = shot.get_tasks()

Requests can be strung together:

>>> sg.get_projects("Demo: Animation")[0].get_sequences("080")[0].get_shots()
[<Shot "bunny_080_0100">, <Shot "bunny_080_0200">, <Shot "bunny_080_0300">]

Core API

The Shotgrid class is a subclass of shotgrid_api3.Shotgrid, so you can drop down to the core API at any time or from any object:

>>> sg.find(filters, fields)
>>> shot.api().find("Task", [["id", "is", 12345]])
[{'type': 'Task', 'id': 12345}]

Download Versions

>>> version = sg.get_projects(show)[0].get_shots(shot)[0].get_versions()[0]
>>> version.movie
<Movie "bunny_080_0200_v001.mov">
>>> version.movie.download("/var/tmp")

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

shotgrid-0.1.1.tar.gz (11.7 kB view details)

Uploaded Source

File details

Details for the file shotgrid-0.1.1.tar.gz.

File metadata

  • Download URL: shotgrid-0.1.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for shotgrid-0.1.1.tar.gz
Algorithm Hash digest
SHA256 339f9e6b11456d550a70e5f89ba15a79cea902c367137731181eb51639abec0b
MD5 65a02f0362d8b0e1c9d99259aee0877b
BLAKE2b-256 b7f531860d986b11933cedb1c52157f312aab3ebe4a6e94f9c6c6b4be5b3eed9

See more details on using hashes here.

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