Registry / devops / shotgun-api3

shotgun-api3

JSON →
library3.10.0pypypi✓ verified 84d ago

Official Python library for accessing the Flow Production Tracking (formerly Shotgun) REST API. The current version is 3.10.0, supporting Python 3.9+. The library is actively maintained by Autodesk and follows a regular release cadence with incremental improvements.

pip install shotgun-api3
INSTALL
IMPORT
SIG · SHOTGUN-API3
S
shotgun-api3
devopspythonv3.10.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Shotgun
from shotgun_api3 import Shotgun
import shotgun_api3.shotgun as Shotgun
The old style was used in earlier versions; now just import the class directly.

Connect to a Shotgun/Flow Production Tracking site and run a simple query. Set environment variables SHOTGUN_URL, SHOTGUN_SCRIPT_NAME, SHOTGUN_API_KEY.

from shotgun_api3 import Shotgun import os # Initialize connection sg = Shotgun( os.environ.get('SHOTGUN_URL', ''), script_name=os.environ.get('SHOTGUN_SCRIPT_NAME', ''), api_key=os.environ.get('SHOTGUN_API_KEY', '') ) # Find assets assets = sg.find('Asset', [['code', 'is', 'MyAsset']], ['id', 'code']) print(assets)
Debug
Known issues
breakingIn version 3.3.0, the default pagination maximum limit changed from 500 to 2000. If your code relied on the old default, adjust pagination logic accordingly.
fix
Explicitly pass the 'limit' parameter to find() calls to ensure expected behavior.
affects: >=3.3.0
deprecatedThe 'schema_read' method is deprecated in favor of schema_entity and schema_field methods. Using schema_read may break in future releases.
fix
Use schema_entity_class_read() or schema_field_read() instead.
affects: >=3.0.0
gotchaWhen creating records, the 'id' field is read-only and should not be passed. The API returns the new id in the response. Attempting to set id will cause an error.
fix
Omit id from create data dictionary.
affects: all
gotchaThe 'retired' field fetching requires explicit permission. By default, retired entities are excluded from find queries. Use 'retired_only': True or specify in filters.
fix
Set the 'retired_only' parameter in find() to include or exclude retired records.
affects: all
Errors
Common errors & fixes
shotgun_api3.shotgun.ShotgunError: API access denied.
Invalid or missing script name or API key, or the script does not have permission.
fix
Double-check your SHOTGUN_URL, SHOTGUN_SCRIPT_NAME, and SHOTGUN_API_KEY. Ensure the script has the necessary permissions in Flow Production Tracking.
shotgun_api3.shotgun.ShotgunError: Entity 'Entity' does not exist.
The entity type string is misspelled or does not exist in the schema.
fix
Use exact entity type names (case-sensitive), e.g., 'Asset', 'Shot', 'Version'. Check valid types via sg.schema_entity_read()
shotgun_api3.shotgun.ShotgunError: Field 'FieldName' does not exist on entity 'EntityType'.
Typo in field name or field is not queryable/visible to the script.
fix
Check field names with sg.schema_field_read('EntityType'). Use exact field names from the schema.
Upgrade
Version history
3.10.0latest on PyPI · released Feb 6, 2026
Audit
Dependencies
requestsrequiredRequired for making HTTP requests to the API.
sixrequiredRequired for Python 2/3 compatibility (legacy, may be phased out).
Agent activity
6 hits · last 30 days
node
6
Resources
shotgun-api3 — pip install shotgun-api3 · libregistry