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.5.tar.gz (11.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: shotgrid-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 1090ebbf7052205a30c1776c90549e117313e1556b49c60af13c8a6986164c34
MD5 1ef95905330b347b16bbc1686bca4ddd
BLAKE2b-256 f4a7ef75ad71f93c7cb2e76976ba4325c2a015b703a45bf7463319dca17008b2

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