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 envstack .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

Then edit 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 = Shotgrid()
>>> 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.4.tar.gz (11.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: shotgrid-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 4800e889ee760d325a2300d0a53bc4e147c8e9f08b13e946d505ca6073d28803
MD5 cc97bba26ff6c34c0bf8abd4a1c98c94
BLAKE2b-256 828af78841aa8b3e7f6b39cc28d70697318128778f95b3e59a33bb69e444ced3

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