Skip to main content

shotgun

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

Installation

The easiest way to install:

$ pip install shotgunwrapper

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 shotgunwrapper.env stack file to keep settings separate.

Start by renaming or copying the example_stack.env file:

$ cp example_stack.env shotgunwrapper.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 shotgun import Shotgun
>>> sg = Shotun()
>>> show = sg.get_projects("Demo: Animation")[0]
>>> shot = show.get_shots("bunny_080_0200")[0]
>>> tasks = shot.get_tasks()

Core API

The Shotgun class is a subclass of shotgun_api3.Shotgun, 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 shotgunwrapper 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shotgunwrapper 0.1.0
File Size Uploaded
shotgunwrapper-0.1.0.tar.gz 11.5 kB Details

Release files / shotgunwrapper-0.1.0.tar.gz

Download URL shotgunwrapper-0.1.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c27c1be5842221cb6e13f3a4085e4f348be64ca1dbc71348ea902048672a3d81
BLAKE2b-256 checksum
How to use checksums
5b0ad53576e6c297620d362c3cc45335ebdbc4c0cc921ac2eba3a6902d7bffe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page