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
File details
Details for the file shotgrid-0.1.2.tar.gz
.
File metadata
- Download URL: shotgrid-0.1.2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 913cd36b4ad0939303003672e7fd63d3e7129621e8b83d91988eebf0d529a226 |
|
MD5 | b7fd3fe8ac3d71f9e513e88e8d544570 |
|
BLAKE2b-256 | ffeb852687e160ce640e94b2a8047d7b418a2554c57b72adfe01d38c0db0056c |