The `wmill` library is the official Python client for interacting with the Windmill platform. It provides a comprehensive set of functions and utilities to manage Windmill resources, variables, and execute scripts or flows. Designed for both module-level convenience functions and advanced class-based usage, it simplifies automation and workflow orchestration within the Windmill ecosystem. The library is actively maintained with frequent updates, usually on a weekly or bi-weekly cadence.
pip install wmillVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the `wmill` client to interact with the Windmill platform. It covers retrieving resources and variables, running other scripts, and direct client instantiation for advanced operations. Authentication is handled automatically within the Windmill environment or via `WM_TOKEN`, `BASE_URL`, and `WORKSPACE` environment variables for local development.
Instantiate `wmill.Windmill()` client separately for each thread or process.
Update calls to `wmill.write_s3_file()` to include `content_type` and `content_disposition` arguments (e.g., `wmill.write_s3_file(s3_obj, content, content_type='application/octet-stream', content_disposition='attachment')`).
Ensure `WM_TOKEN`, `BASE_URL` (e.g., `http://localhost:8000` or your instance URL), and `WORKSPACE` are set in your environment variables before running local scripts that use `wmill`.
For non-standard package name to import root mappings, consider using PEP-723 inline script metadata for explicit dependency specification or contributing to Windmill's exception list. Otherwise, ensure top-level imports directly reflect PyPI package names.
pip install wmill
from wmill.client import WindmillClient client = WindmillClient(api_url="https://app.windmill.dev", api_key="YOUR_API_KEY") # Alternatively, set WM_API_URL and WM_API_KEY environment variables.
import wmill
wmill.scripts.run(script_path="path/to/script", payload={})