A contrived "asset management system" for OpenAssetIO integration test cases.
Project description
The Basic Asset Library (BAL) example manager
The BasicAssetLibrary provides a basic "librarian" asset management system.
It serves to provide a minimum level of functionality to allow simple, repeatable demonstrations and end-to-end tests to be realized with as little supporting infrastructure as possible.
It is not intended to be any kind of comprehensive example of the breadth of functionality exposed though the OpenAssetIO API. See the SampleAssetManager for a more concrete example of canonical manager behavior.
Note: This code is a sketch to facilitate testing and sample workflows. It should never be considered in any way a "good example of how to write an asset management system". Consequently, it omits a plethora of "good engineering practice".
Features
-
Resolves references with the
bal:///
prefix to data from a pre-configured library of assets stored in a.json
file. -
Environment variables are expanded in string-type trait property values (using the
$var
or${var}
syntax, escape$
using$$
). A library can also define arbitrary variables of its own under the top-levelvariables
key. In addition, BAL provides the built-in$bal_library_path
and$bal_library_dir
variables, which can be used to anchor to the current library location. -
The library file to be used is controlled by the
library_path
setting, and this should point to a library file with valid content. -
If no
library_path
has been specified, theBAL_LIBRARY_PATH
env var will be checked to see if it points to a valid library file. -
Persists newly registered data in-memory (the original library JSON is not updated).
-
Simulate network delay with the
simulated_query_latency_ms
setting.Note
Pythons time.sleep is the mechanism by which the delay is triggered. Simulated query latency defaults to 10ms.
Installation
To use the plugin in an OpenAssetIO host, install via pip
, or set (or append) the
OPENASSETIO_PLUGIN_PATH
env var to include the plugin
directory in
a checkout of the source repository.
The plugin provides a manager with the identifier
org.openassetio.examples.manager.bal
.
python -m pip install openassetio-manager-bal
Library file format
A JSON Schema is provided here that validates a BAL library file.
Testing
The test fixtures take care of providing a suitable host environment and configuring the OpenAssetIO plugin search paths for you. Assuming your working directory is set to a checkout of the source repository:
python -m venv .venv
. .venv/bin/activate
python -m pip install -r requirements.txt
python -m pip install -r tests/requirements.txt
python -m pip install .
python -m pytest ./tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file openassetio_manager_bal-1.0.0a8-py3-none-any.whl
.
File metadata
- Download URL: openassetio_manager_bal-1.0.0a8-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b6c2e6d70385df161d799995ca92373fcdaf5c729e4745abbb3fc3fdaa6e25a |
|
MD5 | ec4f25f3a176611a938090efb370adec |
|
BLAKE2b-256 | 27222860f6f43bccd2ba52e93c0bca2510ab499efbe81fd7685d88a3b23c0e78 |