Python SDK
The Airplane Python SDK provides utilities to interact with the Airplane platform.
Installation
The Airplane Python SDK is available as a PyPI package,
airplanesdk
. To install it, run:bashCopied1$ pip install airplanesdk
There's another PyPI package called
airplane
(without the sdk
prefix) that is completely
unrelated to Airplane.dev.Basic usage
Here is a simple example of how the SDK can be used to:
- Select users from a database filtered by name
- Display the selected users in a table
- Return the number of users that matched
pythonCopied1import airplane23@airplane.task(4resources=[airplane.Resource("demo_db")],5)6def lookup_users(name: str):7print(f"Looking up users like '{name}'")8run = airplane.sql.query(9"demo_db",10"""11select id, name, email from users12where (name ilike :name or email ilike :name)13order by name asc14""",15query_args={"name": name}16)17users = run.output["Q1"]18airplane.display.table(users)19return {20"num_users": len(users),21}

Concepts
The SDK reference is broken out into pages for each concept. For details and examples, see the pages
below.