{"id":48765497,"url":"https://github.com/ynput/ayon-shotgrid","last_synced_at":"2026-04-13T07:49:51.848Z","repository":{"id":65903886,"uuid":"592725857","full_name":"ynput/ayon-shotgrid","owner":"ynput","description":"A Shotgrid Addon for the Ayon server.","archived":false,"fork":false,"pushed_at":"2026-04-11T23:57:04.000Z","size":3752,"stargazers_count":12,"open_issues_count":39,"forks_count":16,"subscribers_count":8,"default_branch":"develop","last_synced_at":"2026-04-13T07:49:50.893Z","etag":null,"topics":["addon","ayon"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ynput.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-24T11:58:06.000Z","updated_at":"2026-04-11T23:57:09.000Z","dependencies_parsed_at":"2023-11-09T11:55:59.820Z","dependency_job_id":"69d47927-31ce-4ef1-99ed-4e3e362a6093","html_url":"https://github.com/ynput/ayon-shotgrid","commit_stats":null,"previous_names":[],"tags_count":48,"template":false,"template_full_name":"ynput/ayon-addon-template","purl":"pkg:github/ynput/ayon-shotgrid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynput%2Fayon-shotgrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynput%2Fayon-shotgrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynput%2Fayon-shotgrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynput%2Fayon-shotgrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ynput","download_url":"https://codeload.github.com/ynput/ayon-shotgrid/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynput%2Fayon-shotgrid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31744404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T06:26:45.479Z","status":"ssl_error","status_checked_at":"2026-04-13T06:26:44.645Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addon","ayon"],"created_at":"2026-04-13T07:49:48.173Z","updated_at":"2026-04-13T07:49:51.837Z","avatar_url":"https://github.com/ynput.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shotgrid integration for AYON\n\nThis project provides three elements for the AYON pipeline:\n\n* server/ - The AYON Backend Addon.\n* frontend/ - The AYON server Shotgrid settings tab.\n* client/ - The AYON desktop integration.\n* services/ - Standalone dockerized daemons that act based on events (aka `leecher` and `processors`).\n\nIn order to use this integration, you'll need to run the `python create_package.py` script, which will create a `zip` file with the current version (the number is defined in `package.py`) in `ayon-shotgrid/package/shotgrid-{addon version}.zip`. You can then upload this zip file in your AYON instance, on the Bundles (`/settings/bundles`) section. Make sure you restart the server. AYON should prompt you to do so after uploading.\n\n## Server\nOnce the instance has restarted, you should be able to enable the addon by going into the `Settings \u003e Bundles` and creating (or duplicating an existing) bundle, where you can now choose `shotgrid` and the `version` you installed. Make sure you set the bundle as `Production`.\nIf the addon loaded successfully, you should be able to see a new tab in your `Settings \u003e Shotgrid`.\n\nFor the Shotgrid integration to work, we need to provide several pieces of information. Firstly, we’ll need a Shotgrid Script and its API key. Refer to the [Shotgrid Documentation](https://developer.shotgridsoftware.com/99105475/?title=Create+and+manage+API+scripts) to create one; take note of the information and in AYON, navigate to the `Settings \u003e Secrets` page. Create a new secret with the `script_name` as the \"Secret Name\" and the `script_api_key` as the \"Secret Value\".\n\nWe can now go into the `Settings \u003e Studio settings \u003e Shotgrid` page in AYON and fill in the following fields:\n* Shotgrid URL - This will be the URL to your Shotgrid instance.\n* Shotgrid API Secret - Select the secret you created in the previous step.\n* Shotgrid field for the Project Code - A field in the `Project` entity that holds the project code. It can be an existing one or a new one. The default is `code`.\n* Service Settings \u003e How often (in seconds) to query the Shotgrid Database  - Defaults to 10 seconds, the time between `leeching`, `processing`, and `transmitting` operations.\n\n## Desktop application\nWhen launching AYON for the first time, you'll be asked to provide a login (only the username) for Shotgrid. This is the user that will be used for publishing.\nAfter providing a login, people can publish normally. The integration will ensure that the user can connect to Shotgrid, has the correct permissions, and will create the Version and PublishedFile in Shotgrid if the publish is successful.\n\n## Services\nThe services are a way to handle operations between AYON and Shotgrid in the background. These have been developed around the AYON Events system. We replicate Shotgrid events (the ones we care about) as AYON `shotgrid.event`, which then the `processor` will pick up and process them accordingly. Lastly, the `transmitter` will look for changes in AYON and attempt to replicate them in Shotgrid.\nIn any case, the Shotgrid project has to have the field \"Ayon Auto Sync\" enabled for the `leecher` and the `transmitter` to work.\nThey share code, which is found in `shotgrid_common`. Most importantly, the `AyonShotgridHub` is a class that bootstraps common actions when working with AYON and Shotgrid.\n\nThe three provided services are:\n\n* `processor` - This has a set of handlers for different `shotgrid.event` and acts on them.\n* `leecher` - Periodically queries the `EventLogEntry` table on Shotgrid and ingests any event that interests us, dispatching it as a `shotgrid.event`. This will only query projects that have the \"Ayon Auto Sync\" field enabled.\n* `transmitter` - Periodically checks for new events in AYON of topic `entity.*` and pushes any changes to Shotgrid, only affecting projects that have the \"Ayon Auto Sync\" field enabled.\n\nThe most straightforward way to get this up and running is by using ASH (AYON Service Host). After loading the Addon on the server, you should be able to spawn services in the \"Services\" page.\n\n### Development\nThere's a single `Makefile` at the root of the `services` folder, which is used to `build` the Docker images and to run the services locally with the `dev` target. This is UNIX only for the time being. Running `make` without arguments will print information as to how to run and use it.\n\n#### Building Docker Images\nTo build the Docker images, you can run `make SERVICE=\u003cservice-name\u003e build`. So, for example, to build the `processor`, you'd do `make SERVICE=processor build`. This will build and tag the local image, with the version found in `package.py` at the root of the addon.\n\n#### Running the Service locally\nIn order to run the service locally, we need to specify certain environment variables. To do so, copy the `sample_env` file, rename it to `.env`, and fill the fields accordingly:\n\n```\nAYON_API_KEY=\u003cAYON_API_KEY\u003e # You can create a `service` user in AYON, and then get the Key from there.\nAYON_SERVER_URL=\u003cYOUR_AYON_URL\u003e\nPYTHONDONTWRITEBYTECODE=1\n```\n\nWe are ready to spin up the service. For convenience, we got a `make` target for this:\n\n```sh\nmake SERVICE=\u003cservice-name\u003e dev\n```\n\nYou should now see something similar to:\n\n```sh\nINFO       Initializing the Shotgrid Processor.\nDEBUG      Found these handlers: {'create-project': [\u003cmodule 'project_sync'\u003e], 'sync-from-shotgrid': [\u003cmodule 'sync_from_shotgrid'\u003e], 'shotgrid-event': [\u003cmodule 'update_from_shotgrid'\u003e]}\nINFO       Start enrolling for AYON `shotgrid.event` Events...\nINFO       Querying for new `shotgrid.event` events...\nINFO       No event of origin `shotgrid.event` is pending.\n```\n\n### Makefile commands\n\nFor those who cannot use `Makefiles`, here are the commands that are required to perform the same action as with `make`, using the `processor` version `0.2.` as an example, from the `services` folder:\n\nBuilding the Docker image:\n\n ```sh\n docker build -t ynput/ayon-shotgrid-processor:0.2.1 -f processor/Dockerfile .\n```\n\nRunning a service locally:\n\n```sh\ndocker run --rm -u ayonuser -ti \\\n  -v services/shotgrid_common:services/shotgrid_common:Z \\\n  -v services/processor:/service:Z \\\n  --env-file services/processor/.env \\\n  --env AYON_ADDON_NAME=shotgrid \\\n  --env AYON_ADDON_VERSION=0.2.1 \\\n  --attach=stdin \\\n  --attach=stdout \\\n  --attach=stderr \\\n  --network=host \\\n  ynput/ayon-shotgrid-processor:0.2.1 python -m processor\n```\n\nThis one is trickier since the Makefile will symlink the `shotgrid_common` inside the `service/processor` folder.\n\n### Running it without docker or make\nYou don't need to run these as Dockerized scripts; for that, you'll need either [Poetry](https://python-poetry.org/) installed and create an environment specified by the `pyproject.toml` or using `virtualenv` and install the packages specified in the `[tool.poetry.dependencies]` section of the `pyproject.toml`; once in that environment, you'll need to load the contents of the `.env` file and finally:\n\n```sh\npython -m processor\n```\n\n# Usage\nWith this integration, you can perform the following actions by navigating to `AYON \u003eSettings \u003e Shotgrid` and loading all projects by clicking `Populate Data`:\n\n## Import a New Shotgrid Project\nWith the `processor` service running, synchronize `Shotgrid --\u003e AYON` will replicate the Shotgrid structure in AYON.\n\n## Export an AYON project into Shotgrid\nWith the `processor` service running, synchronize `AYON --\u003e Shotgrid` will replicate the AYON structure in Shotgrid.\n\n## Update based on Shotgrid Events\nWith the `leecher` **and** the `processor` services running, and the `Ayon Auto Sync` field **enabled** in Shotgrid, whenever an event on `Episodes`, `Sequences`, `Shots`, or `Tasks` occurs, an event will be dispatched in Ayon `shotgrid.event`; this event will be then processed in another event `shotgrid.proc` dispatched by the `processor` service; this currently creates and removes entities and updates the name of entities so they are in sync between Shotgrid and Ayon.\n\n## Update based on AYON Events\nWith the `transmitter` **and** the `processor` services running, and the `Ayon Auto Sync` field **enabled** in Shotgrid, whenever an event on `entity.*` occurs in AYON, an event will be dispatched in Ayon `shotgrid.push`; this event will attempt to replicate the changes made in AYON in Shotgrid.\n\nIn all instances, you'll want to keep an eye on the terminal where you launched the services, where you can track the progress of any of the handlers. This will be improved in the future so it can be tracked from AYON.\n\n\n# Automated tests\n\nThese tests do not yet cover all use cases and features provided by the sync services.\nInstead, they act as a safety net to proactively catch regressions on core functionalities.\n\nWe strongly recommend running them locally with each new contribution.\nThey require a local AYON server but no FLOW instance, thanks to [Mockgun](https://github.com/shotgunsoftware/python-api/blob/master/shotgun_api3/lib/mockgun/mockgun.py), which simulates a FLOW environment entirely in memory.\n\n\n## Requirements\n\n* Your local `python` should be \u003e=3.10\n* You need a local AYON server with a service AYON_API_KEY defined\n\n## Run the tests\n\nWindows:\n```shell\n.\\service_tools\\manage.ps1 run-tests\n```\n\nLinux:\n```\n./service_tools/make runtests\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fynput%2Fayon-shotgrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fynput%2Fayon-shotgrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fynput%2Fayon-shotgrid/lists"}