Python SDK quick start
This page removes a watermark from an image with the SDK. After you install it and set your API keys, run either the Python or the CLI example. You need Python 3.9 or later and a test image. The shell commands below work on macOS and Linux.
1. Download the ZIP and install the SDK
Download the Vmake Labs Python SDK v2.0.3 (ZIP), or download and extract it in a terminal:
Create a virtual environment in the extracted directory and install the .whl file. If you use other builds of action-api-sdk, install each one in its own virtual environment.
If you see SkillClient and the command help, both the Python module and the CLI are installed. Run the following examples in the same virtual environment.
2. Set your API keys
Create a key pair on the API keys page of the Vmake Labs developer center. Put the Access Key in MT_AK and the Secret Key in MT_SK.
You can also copy .env.example in the extracted directory to .env, fill in the same two variables, and run your Python scripts or the CLI from that directory. Keep the .env file that holds your keys out of version control.
3. Run your first task
List image tools
Submit an image and read the result
Keep using client in the same script. Check that the catalog includes SKM0006, and replace the path with your test image. run_task uploads the image and consumes quota according to the task rules.
The method returns the raw tool response. When the task completes, read the output from data.result. on_async_submitted receives the task_id of an asynchronous task before polling starts. If run_task returns None because polling ended without a final status, continue with client.poll_task_status(task_id).
The SDK polls at the intervals the server provides. If those intervals add up to less than 60 minutes, the SDK repeats the last interval until they do. The default interval is 60 seconds.
Troubleshooting
Set WAPI_DEBUG=1 to see sanitized request details from the CLI. Check the headers and body before you share logs.