Autodesk Platform Service APIs Python SDK
Project description
py-aps
Python SDK for Autodesk Platform Service APIs
Installation
pip install py-aps
Overview
py-aps is a Python SDK that provides a simple and intuitive interface for interacting with Autodesk Platform Services (formerly known as Forge) APIs. This SDK simplifies authentication, data management, and automation workflows for APS-powered applications.
Features
- Authentication: Easy OAuth2 authentication flow
- Data Management: Access and manage files in BIM 360, ACC, and other Autodesk cloud storage
- Automation: High-level workflow API for executing WorkItems with automatic file management and webhook support
- Proxy Support: HTTP/HTTPS proxy configuration for enterprise environments (v0.0.6+)
Quick Start
Authentication
from pyaps.auth import AuthClient, Scopes
# 2-legged OAuth
client = AuthClient(client_id="...", client_secret="...")
token = client.two_legged.get_token([Scopes.DATA_READ])
Data Management
from pyaps.datamanagement import DataManagementClient
dm = DataManagementClient(token_provider=lambda: token.access_token)
# List hubs and projects
hubs = list(dm.hubs.list())
projects = list(dm.hubs.list_projects(hub_id))
# Browse folders
contents = list(dm.folders.contents(project_id, folder_id))
Automation (High-Level Workflow)
from pyaps.automation import AutomationWorkflow
workflow = AutomationWorkflow(
automation_client=auto_client,
data_client=dm_client,
default_bucket="my-bucket",
)
# Execute WorkItem with automatic file management
result = workflow.run_workitem_with_files(
activity_id="Owner.MyActivity+prod",
input_files={"inputFile": "path/to/input.rvt"},
output_files={"outputFile": "output.rvt"},
)
# With webhooks (no polling required)
result = workflow.run_workitem_with_files(
activity_id="Owner.MyActivity+prod",
input_files={"inputFile": "input.rvt"},
output_files={"outputFile": "output.rvt"},
on_complete_url="https://myapp.com/webhook/complete",
)
Automation (Low-Level API)
from pyaps.automation import AutomationClient
auto = AutomationClient(token_provider=lambda: token.access_token)
# List engines
engines = auto.list_engines()
# Start workitem (manual setup required)
workitem = auto.start_workitem({
'activityId': 'Owner.MyActivity+prod',
'arguments': {...}
})
Proxy Configuration (v0.0.6+)
# Explicit proxy configuration
client = AuthClient(
client_id="...",
client_secret="...",
proxies={
'http': 'http://proxy.company.com:8080',
'https': 'https://proxy.company.com:8080'
}
)
# Or use environment variables (HTTP_PROXY, HTTPS_PROXY)
client = AuthClient(
client_id="...",
client_secret="...",
trust_env=True # Default - reads from environment
)
For more examples and detailed documentation:
- AutomationWorkflow Guide:
src/pyaps/automation/WORKFLOW.md - Workflow Examples:
src/pyaps/automation/workflow_example.py - Low-Level Examples:
src/pyaps/automation/example.py - Auth Examples:
src/pyaps/auth/example.py - Data Management Examples:
src/pyaps/datamanagement/example.py - Proxy Examples:
src/pyaps/http/proxy_example.py
Project Status
Current version: v0.0.6 - Proxy support for enterprise environments
This package is currently in early development. Active development is underway by voidbox.
Version History
- v0.0.6 - Added HTTP/HTTPS proxy support for enterprise environments (configurable via explicit settings or environment variables)
- v0.0.5 - Added AutomationWorkflow high-level API with automatic file management, webhook support (onComplete/onProgress), batch processing, and comprehensive documentation
- v0.0.4 - Added Automation API client (Engines, AppBundles, Activities, WorkItems)
- v0.0.3 - Added Data Management API client (Hubs, Projects, Folders, Items, Versions, Buckets, Objects)
- v0.0.2 - Added OAuth 2.0 authentication client with 2-legged/3-legged flows, PKCE support, and token management
- v0.0.1 - Initial package release (placeholder)
Contributing
We welcome bug reports and feature requests through GitHub Issues.
This project is primarily developed by voidbox. External pull requests have limited review capacity.
License
Apache-2.0 License - see the LICENSE file for details.
Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_aps-0.0.6.tar.gz.
File metadata
- Download URL: py_aps-0.0.6.tar.gz
- Upload date:
- Size: 39.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
513d345249f410b16a8b67d7d2e3ae9675ac52f96da2d78f2d9b144e5bc35203
|
|
| MD5 |
9c719a83cb6df8ecab221cb57b2c5bfd
|
|
| BLAKE2b-256 |
a6d3397a136395ce07eb26428726c7c7a1566606553a5aec4d3085f75d5aa20b
|
File details
Details for the file py_aps-0.0.6-py3-none-any.whl.
File metadata
- Download URL: py_aps-0.0.6-py3-none-any.whl
- Upload date:
- Size: 46.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
542fdead0ae476acf045d2c3da45c5c7a10b93428b550e9e4d670129f941ef89
|
|
| MD5 |
9d423bef3c8f30bd21b5b8763700da9f
|
|
| BLAKE2b-256 |
19fbbb61125947f5d67f3bfc7f0ca630a14458d75e84e8f4209393c09b41bf1f
|