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
LOG_LEVEL: INFO
SG_SCRIPT_URL: https://example.shotgunstudio.com
SG_SCRIPT_NAME: script_name
SG_SCRIPT_KEY: XXXXXX
```
## 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/b6/60/7ea2f8234766ad35961a4979e05f4c31215f580bf325f0c0fe0de69434c3/shotgrid-0.2.1.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\nLOG_LEVEL: INFO\nSG_SCRIPT_URL: https://example.shotgunstudio.com\nSG_SCRIPT_NAME: script_name\nSG_SCRIPT_KEY: XXXXXX\n```\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.1",
"project_urls": {
"Homepage": "http://github.com/rsgalloway/shotgrid"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b6607ea2f8234766ad35961a4979e05f4c31215f580bf325f0c0fe0de69434c3",
"md5": "871e42710d32085c666b99145760cfa4",
"sha256": "405010dcf8261b1e94f84434bf999994d6cd6eea491dbd55c7f9f936729a7375"
},
"downloads": -1,
"filename": "shotgrid-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "871e42710d32085c666b99145760cfa4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 11770,
"upload_time": "2024-12-14T15:59:05",
"upload_time_iso_8601": "2024-12-14T15:59:05.328507Z",
"url": "https://files.pythonhosted.org/packages/b6/60/7ea2f8234766ad35961a4979e05f4c31215f580bf325f0c0fe0de69434c3/shotgrid-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-14 15:59:05",
"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.7.2"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "shotgun_api3",
"specs": [
[
"==",
"3.5.1"
]
]
}
],
"lcname": "shotgrid"
}