mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 16:02:10 +00:00
528cca268b
* Fix references to `Windmill.start_script_async` * Improve client usability and extend functionalities This commit introduces several changes to improve the usability of the module and extend its functionalities. Line breaks have been added for long function calls to improve readability. A state setter has been added for the 'state' property to facilitate state updates. New functions 'cancel_running' and 'run_script' have been added to provide more control to the user over the script executions. The README file has been updated to reflect these changes and provide more comprehensive usage instructions including both basic and advanced usage of the module. * Add line breaks and update README.md for readability Inserted line breaks into function calls for improved readability in python-client/wmill/README.md. This enhances module usability by making code easier to follow. 'state' property setter, 'cancel_running' and 'run_script' functions have been added to enrich module's functionality. README was updated to reflect these changes and provide clearer instructions.
wmill
The client for the Windmill platform
Quickstart
import wmill
# with a WM_TOKEN env variable
client = wmill.Client()
# without a WM_TOKEN env variable
client = wmill.Client(token="<mytoken>")
def main():
version = client.get_version()
resource = client.get_resource("u/user/resource_path")
# run synchronously, will return the result
res = client.run_script_sync(hash="000000000000002a", args={})
print(res)
for _ in range(3):
# run asynchrnously, will return immediately. Can be scheduled
client.run_script_async(hash="000000000000002a", args={}, scheduled_in_secs=10)