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, import the SDK and create a client:
from airplanesdk import Airplane
airplane = Airplane()
You can then use the SDK to produce outputs which will be separated from your logs:
airplane.writeOutput("Show me what you got")
# You can also separate outputs into groups by attaching names:
airplane.writeNamedOutput("saying", "Show me what you got")
airplane.writeNamedOutput("saying", "Welcome to the club, pal")
airplane.writeNamedOutput("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
taskId = "..."
runOutput = airplane.run(taskId, {
# 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 a dict of outputs, by name.
# Default outputs are available as `runOutput.output`.
print(runOutput)
Contributing
Deployment
To deploy a new version of this SDK:
- Bump the version number in
pyproject.toml
andairplanesdk/__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.1.1.tar.gz
(3.6 kB
view details)
Built Distribution
File details
Details for the file airplanesdk-0.1.1.tar.gz
.
File metadata
- Download URL: airplanesdk-0.1.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.1 Darwin/20.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 703c7bf7b7fbb9a7968780e14aa8939a2984d1fcffe4cad6610de3ccf900a1c1 |
|
MD5 | aa0ca1dcc46c02e4e7533653ee57acbe |
|
BLAKE2b-256 | a025ec6096f70dd38192ef9f2cb263a0b4aac6693dae61231a9bf6fe4e4cf2a6 |
File details
Details for the file airplanesdk-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: airplanesdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.1 Darwin/20.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce1d5b4ade82d83f02b62debac4091ad94ae778492757ec8fbda603c5362e659 |
|
MD5 | e65efe6ee29f34a0723dbf2625ef93a6 |
|
BLAKE2b-256 | 9d62e71543693ddc00214a3ae4eb45ae08e1c22cd734fea5d9ce20ed27fe6417 |