Metadata-Version: 2.1
Name: airplanesdk
Version: 0.2.2
Summary: A Python SDK for writing Airplane tasks
Home-page: https://airplane.dev
License: MIT
Author: Airplane
Author-email: support@airplane.dev
Requires-Python: >=3.6,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: backoff (>=1.10.0,<2.0.0)
Requires-Dist: requests (>=2.25.1,<3.0.0)
Project-URL: Repository, https://github.com/airplanedev/python-sdk
Description-Content-Type: text/markdown

# Airplane Python SDK [![PyPI](https://img.shields.io/pypi/v/airplanesdk)](https://pypi.org/project/airplanesdk/) [![PyPI - License](https://img.shields.io/pypi/l/airplanesdk)](./LICENSE) [![Docs](https://img.shields.io/badge/Docs-Python%20SDK-blue)](https://docs.airplane.dev/reference/runtime-api-and-airplane-sdk/python-sdk)

An SDK for writing Airplane tasks in Python.

## Usage

First, install the SDK:

```sh
pip install airplanesdk
```

Next, you can use the SDK to produce outputs which will be separated from your logs:

```python
import airplane

airplane.write_output("Show me what you got")

# You can also separate outputs into groups by attaching names:
airplane.write_named_output("saying", "Show me what you got")
airplane.write_named_output("saying", "Welcome to the club, pal")
airplane.write_named_output("name", "Summer")
```

This SDK can be used to programmatically kick off tasks and fetch their output:

```python
# You can get a task's ID from the URL bar, f.e.
# https://app.airplane.dev/tasks/1oMt2mZC1DjkOZXxHH8BV57xrmF
task_id = "..."
resp = airplane.run(task_id, {
  # Optionally provide parameters to your task, using the same name
  # as when templating a parameter into your task's CLI args.
  "DryRun": True,
})

# run() will return the run's status (Succeeded, Failed, Cancelled) and a
# dict of outputs, by name.
#
# Default outputs are available as `resp["outputs"]["output"]`.
print(resp["outputs"])
```

