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:
```bash
$ pip install -U shotgrid
```
Alternatively, use [distman](https://github.com/rsgalloway/distman) to dist to a
deployment area using options defined in the `dist.json` file:
```bash
$ distman [-d]
```
## Configuration
Default settings are stored in an [envstack](https://github.com/rsgalloway/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:
```bash
$ cp example_shotgrid.env shotgrid.env
```
Then edit it's contents with the appropriate values:
```yaml
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](https://github.com/rsgalloway/envstack?tab=readme-ov-file#encryption).
```yaml
SG_SCRIPT_KEY: !encrypt XXXXXXXXXXXX
SG_SCRIPT_NAME: !encrypt XXXXXXXXXXXX
```
Using AES-GCM or Fernet encryption, keys can be safely stored.
## Usage
Basic usage:
```python
>>> 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:
```python
>>> 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:
```python
>>> sg.find(filters, fields)
>>> shot.api().find("Task", [["id", "is", 12345]])
[{'type': 'Task', 'id': 12345}]
```
#### Download Versions
```python
>>> 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")
```
Raw data
{
"_id": null,
"home_page": "http://github.com/rsgalloway/shotgrid",
"name": "shotgrid",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Ryan Galloway",
"author_email": "ryan@rsgalloway.com",
"download_url": "https://files.pythonhosted.org/packages/ea/d4/be3d42c2330e301d05e32bb53192bbf2c7c340fd818c65b280db975f94b8/shotgrid-0.2.2.tar.gz",
"platform": null,
"description": "shotgrid\n========\n\nThis is an object-oriented wrapper around the shotun api3 Python API, that\nincludes classes for each shotgrid entity type with convenience methods.\n\n## Installation\n\nThe easiest way to install:\n\n```bash\n$ pip install -U shotgrid\n```\n\nAlternatively, use [distman](https://github.com/rsgalloway/distman) to dist to a\ndeployment area using options defined in the `dist.json` file:\n\n```bash\n$ distman [-d]\n```\n\n## Configuration\n\nDefault settings are stored in an [envstack](https://github.com/rsgalloway/envstack)\nenvironment stack file. They can be stored in the default stack, or in a\nnamespaced `shotgrid.env` stack file to keep settings separate.\n\nStart by renaming or copying the `example_shotgrid.env` file:\n\n```bash\n$ cp example_shotgrid.env shotgrid.env\n```\n\nThen edit it's contents with the appropriate values:\n\n```yaml\nSG_SCRIPT_URL: https://example.shotgunstudio.com\nSG_SCRIPT_NAME: script_name\nSG_SCRIPT_KEY: XXXXXXXXXXXX\n```\n\n#### Encrypted keys\n\nTo use encrypted keys in the env file, see the encryption instructions on the\nenvstack README [here](https://github.com/rsgalloway/envstack?tab=readme-ov-file#encryption). \n\n```yaml\nSG_SCRIPT_KEY: !encrypt XXXXXXXXXXXX\nSG_SCRIPT_NAME: !encrypt XXXXXXXXXXXX\n```\n\nUsing AES-GCM or Fernet encryption, keys can be safely stored.\n\n## Usage\n\nBasic usage:\n\n```python\n>>> from shotgrid import Shotgrid\n>>> sg = Shotgrid()\n>>> show = sg.get_projects(\"Demo: Animation\")[0]\n>>> shot = show.get_shots(\"bunny_080_0200\")[0]\n>>> tasks = shot.get_tasks()\n```\n\nRequests can be strung together:\n\n```python\n>>> sg.get_projects(\"Demo: Animation\")[0].get_sequences(\"080\")[0].get_shots()\n[<Shot \"bunny_080_0100\">, <Shot \"bunny_080_0200\">, <Shot \"bunny_080_0300\">]\n```\n\n#### Core API\n\nThe Shotgrid class is a subclass of shotgrid_api3.Shotgrid, so you can drop down\nto the core API at any time or from any object:\n\n```python\n>>> sg.find(filters, fields)\n>>> shot.api().find(\"Task\", [[\"id\", \"is\", 12345]])\n[{'type': 'Task', 'id': 12345}]\n```\n\n#### Download Versions\n\n```python\n>>> version = sg.get_projects(show)[0].get_shots(shot)[0].get_versions()[0]\n>>> version.movie\n<Movie \"bunny_080_0200_v001.mov\">\n>>> version.movie.download(\"/var/tmp\")\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Pythonic Shotgrid API wrapper",
"version": "0.2.2",
"project_urls": {
"Homepage": "http://github.com/rsgalloway/shotgrid"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ead4be3d42c2330e301d05e32bb53192bbf2c7c340fd818c65b280db975f94b8",
"md5": "bd96496d5a1d35becc2a7fd6b0468d61",
"sha256": "745f0a3c31b4b999412dbadb0b70535f04e9b34ed541d0ddb7776511660b2ec4"
},
"downloads": -1,
"filename": "shotgrid-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "bd96496d5a1d35becc2a7fd6b0468d61",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 12074,
"upload_time": "2025-03-03T14:42:49",
"upload_time_iso_8601": "2025-03-03T14:42:49.742557Z",
"url": "https://files.pythonhosted.org/packages/ea/d4/be3d42c2330e301d05e32bb53192bbf2c7c340fd818c65b280db975f94b8/shotgrid-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-03-03 14:42:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rsgalloway",
"github_project": "shotgrid",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "envstack",
"specs": [
[
">=",
"0.8.3"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "shotgun_api3",
"specs": [
[
"==",
"3.5.1"
]
]
}
],
"lcname": "shotgrid"
}