This is a Python sample, created in form of a CLI tool that helps to automate the process of reading collections, projects and assets using the M&E Data Model GraphQL API.
- Python: Download Python. It is required to use Python > 3.13.
- APS Account: Learn how to create an APS Account, activate subscription and create an app at this tutorial.
The Data Exchange calls requires 3-legged authenticated token.
To simplify the sample and have only the minimum necessary code focused on M&E Data Model, the Authentication code is missing on purpose.
To run the sample, it is required to have the 3-legged authenticated token and set the AUTH_TOKEN var within config.py file.
Within the project folder:
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
For Windows:
venv\Scripts\activate.bat
For Linux/MacOS systems:
source venv/bin/activate
- Install dependencies via pip:
pip install -r requirements.txt
- The app can be called by running
python main.py
or you can set an alias:
alias medm="python3 main.py"
and call the app with further commands:
medm getcollections
For the entire list of commands check the documentation for the app.
- For brevity purpose, the error handling is missing from the code and almost all errors will default to
"ERROR: The Auth token expired"
These samples are licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Denis Grigor (denis.grigor@autodesk.com), APS Partner Development
See more at Developer Community Blog.