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 -U shotgrid
Alternatively, use distman to dist to a
deployment area using options defined in the dist.json file:
$ distman [-d]
Configuration
Default settings are stored in an envstack
environment stack 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:
SG_SCRIPT_URL: https://example.shotgunstudio.com
SG_SCRIPT_NAME: script_name
SG_SCRIPT_KEY: XXXXXXXXXXXX
Encrypted keys
To use encrypted keys in the env file, see the encryption instructions on the envstack README here.
SG_SCRIPT_KEY: !encrypt XXXXXXXXXXXX
SG_SCRIPT_NAME: !encrypt XXXXXXXXXXXX
Using AES-GCM or Fernet encryption, keys can be safely stored.
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")
Metadata
Release files for shotgrid 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shotgrid-0.3.0.tar.gz | 12.6 kB | Without provenance | Details for shotgrid-0.3.0.tar.gz |
Release files / shotgrid-0.3.0.tar.gz
| Download URL | shotgrid-0.3.0.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d5ef879820db194c89e4fe5d51e84682f84c28b8408f0e6b6f93d4edcb7bda7
|
|
BLAKE2b-256 checksum How to use checksums |
a068c77dcda0bedaad0e422bd2760001a5dca3e6a6eb07eeafe49e74aca36e88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.8.10
|
Security for shotgrid 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.