Skip to content

Python SDK

The Python SDK exists because a massive population of Shortcuts-adjacent developers write Python all day and shouldn’t have to learn TypeScript just to ship an App Intent.

Install

Terminal window
pip install axint

Requires Python 3.11 or newer. No runtime dependencies — the parser walks the stdlib ast module and never executes your code, which means axint parse is deterministic, sandboxable, and safe to run on untrusted input.

Hello, intent

intents/create_event.py
from axint import define_intent, param
create_event = define_intent(
name="CreateCalendarEventIntent",
title="Create Calendar Event",
description="Creates a new event on the user's calendar.",
domain="productivity",
params={
"event_title": param.string("Title of the event"),
"start_date": param.date("When the event starts"),
"duration_minutes": param.int("Length of the event in minutes"),
"is_all_day": param.boolean(
"Whether the event is all-day", optional=True, default=False
),
},
entitlements=["com.apple.developer.calendars"],
info_plist_keys=["NSCalendarsUsageDescription"],
)

Compile it

Terminal window
axint parse intents/create_event.py # print the IR
axint parse intents/create_event.py --json # IR as JSON
axint compile intents/create_event.py # IR → Swift (via @axint/compiler)

axint compile shells out to @axint/compiler under the hood, so the Swift output is byte-identical to what you’d get from writing the same intent in TypeScript. One source of truth for the Swift generator means one thing to break.

Why stdlib only?

The parser is built on Python’s stdlib ast module. No libcst, no typed_ast, no third-party runtime deps at all. That’s a deliberate choice:

  • Faster installpip install axint is a few kilobytes.
  • Deterministic — the parser never runs your code, so a malicious or broken intent file can’t execute arbitrary Python.
  • Sandboxable — you can run axint parse inside a tiny Docker image with no network access.

Parity with TypeScript

FeatureTypeScriptPython
define_intent / defineIntent
param.string/int/double/...
entitlements, info_plist_keys
is_discoverable
Multi-intent files✅ (parse)
Swift codegen⚠️ via TS
Return-type inference🟡 v0.3.0
MCP server🟡 v0.3.0

Next steps