Pythonic Shotgun API wrapper
Project description
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")
Project details
Release history Release notifications | RSS feed
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 shotgunwrapper-0.1.0.tar.gz
.
File metadata
- Download URL: shotgunwrapper-0.1.0.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c27c1be5842221cb6e13f3a4085e4f348be64ca1dbc71348ea902048672a3d81 |
|
MD5 | cecb25a13350324191f688cf13dd3578 |
|
BLAKE2b-256 | 5b0ad53576e6c297620d362c3cc45335ebdbc4c0cc921ac2eba3a6902d7bffe3 |