write-script-python3

Write Windmill Python scripts with resource types, wmill SDK, and CLI preview commands.

Updated May 28, 2026
One-click install
npx skills add https://github.com/kma-core/windmill --skill write-script-python3-kma-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-script-python3
Source: https://github.com/kma-core/windmill/tree/main/system_prompts/auto-generated/skills/write-script-python3
Command: npx skills add https://github.com/kma-core/windmill --skill write-script-python3-kma-core

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires wmill.

What problem does it solve? Writing Python scripts for the Windmill platform requires following specific conventions: a main entrypoint, TypedDict resource types, the wmill SDK, and the correct CLI commands for previewing versus deploying. This Skill encodes all of those rules so generated scripts work on the first run. ## Core Features & Use Cases - Script Structure Enforcement: Ensures every script defines a typed main function, declares resource types as lowercase TypedDicts, and avoids import-name conflicts with resource types. - wmill SDK Reference: Provides the full Python SDK surface, including running scripts and flows, managing variables and resources, S3 file operations, workflow-as-code decorators (@task, @workflow), approvals, and state management. - CLI Workflow Guidance: Distinguishes wmill script preview for local iteration from wmill script run and wmill sync push for deployed code, preventing accidental deploys of untested changes. - Use Case: Ask for a script that reads a PostgreSQL table and uploads a report to S3; the output includes the postgresql TypedDict, correct wmill S3 calls, and a ready-to-run wmill script preview command with sample arguments. ## Quick Start Write a Windmill Python script that fetches data from an API and stores the result in an S3 file, then preview it locally.

Frequently Asked Questions about write-script-python3

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Python script for Windmill?

Define a typed `main` function with your parameters; Windmill auto-generates the UI from its signature. Declare any credentials as lowercase TypedDict resource types before `main`, and import `wmill` for platform interactions like variables, resources, and S3.

How do I test a Windmill script locally without deploying?

Run `wmill script preview <script_path>` with optional `-d '<args>'` to execute the local file without deploying. Use `wmill script run` only for scripts already deployed in the workspace, and `wmill sync push` only when explicitly publishing changes.

How do I use database credentials in a Windmill Python script?

Define a TypedDict matching the resource type, such as `postgresql` with host, port, user, password, and dbname fields, then add it as a parameter to `main`. Windmill injects the resource value at runtime; the type name must be lowercase.

Can Windmill Python scripts read and write S3 files?

Yes. Type a parameter as `S3Object` from `wmill` to receive files, then use `wmill.load_s3_file` or `wmill.load_s3_file_reader` to read and `wmill.write_s3_file` to write. Helpers also exist for presigned URLs and DuckDB, Polars, or boto3 connection settings.

What happens if an import name conflicts with a Windmill resource type?

Rename the imported module, not the resource type. For example, use `import stripe as stripe_sdk` while keeping `class stripe(TypedDict)` as the resource type, since resource type names must stay lowercase and unchanged.