Metadata-Version: 2.1
Name: ayon-openassetio-manager-plugin
Version: 0.1.2
Summary: AYON Manager Plugin for OpenAssetIO hosts.
Author: input.io
Author-email: info@ynput.io
Requires-Python: >=3.9.1
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Plugins
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Multimedia :: Graphics
Requires-Dist: openassetio
Requires-Dist: openassetio-mediacreation
Requires-Dist: requests
Project-URL: Bug Tracker, https://github.com/ynput/ayon-openassetio-manager-plugin/issues
Project-URL: Discussions, https://community.ynput.io/
Description-Content-Type: text/markdown

AYON OpenAssetIO Manager Plugin
===============================

This is implementing manager interface for [OpenAssetIO](https://github.com/OpenAssetIO/OpenAssetIO). With it,
any OpenAssetIO enabled host (DCC) can be used to load data from [AYON](https://ayon.ynput.io/). This is a work in
progress, and it depends on OpenAssetIO Traits to be supported by the host. Once up adn running, OpenAssetIO host should
understand AYON URIs in a form of 
```
ayon+entity://{project}/{asset}?product={product}&version={version}&representation={representation}
```
like
```
ayon+entity://TestProject/assets/Alice?product=modelMain&version=v002&representation=abc
```

Installation
------------

To manage your installation, use `./tools/manage.ps1` on Windows and `./tools/manage.sh` on Linux and macOS. It accepts
commands as arguments, run it without arguments to see the list of available commands.

* `create-env` - creates virtual environment for development using [Poetry](https://python-poetry.org/)
* `generate-traits` - generates Python traits using openassetio-tratsgen from `traits.yml` file and puts them into `ayon_traits` module.
* `run-tests` - runs test

Building
--------

You can build the plugin as Python wheel using Poetry. Run `poetry build` to build the wheel.
It will be located in `dist` directory.

Usage
-----

To use this plugin, make sure you point `OPENASSETIO_PLUGIN_PATH` environment variable to the directory where this plugin is located.
You can use `OPENASSETIO_DEFAULT_CONFIG` pointing to `pyproject.toml` file to set default configuration for the plugin.

Also make sure plugin Python environment is available inside the host. So far it needs only `requests`, `openassetio` and `openassetio_mediacreation`.
To tell manager how to connect to AYON, set `AYON_SERVER_URL` environment variable to the server address and `AYON_API_KEY` to the API key.

To get the correct formatted paths, you need to have AYON site id - unique identifier of your local site that can be determined from hostname
and platform. Server can determine your site id from that and use it for all subsequent requests. Site id is stored on server once
you first run AYON launcher and connect it to the server. In other words, you need to run AYON launcher at least once to get correct results.
This needs to be handled later on more gracefully.

Development
-----------

To run tests, you need to configure your AYON server in `tests/conftest.py` file. Set `AYON_SERVER_URL` and `AYON_API_KEY` at the top of the file.

**TODO:**

- [ ] Handle site id determination more gracefully
- [ ] Better error handling
- [ ] Better logging
- [ ] More tests
- [ ] Implement missing methods

