A Python SDK for writing Airplane tasks
Project description
Airplane Python SDK
An SDK for writing Airplane tasks in Python.
Usage
First, install the SDK:
pip install airplanesdk
Next, you can use the SDK to produce outputs which will be separated from your logs:
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:
# 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"])
Contributing
Deployment
To deploy a new version of this SDK:
- Bump the version number in
pyproject.toml
andairplane/__init__.py
- Run the following to build and publish to PyPI:
poetry publish --build --username=airplane
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
airplanesdk-0.2.0.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for airplanesdk-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c3c040e8e3dc254187eec0dbc3285213c3c97bb8e8609c27dec896bbecb6c34 |
|
MD5 | 51e2d8f83c70a756d4dda1b1d7aba4fa |
|
BLAKE2b-256 | 16e8b7f882441e32ef76ad8e861182034e6bff6cce377801413bb69c1726a1c2 |