This package provides an abstraction layer between Swimlane and Python Scripts.
Project description
Swimlane Core
The swimlane-core is a Python package that provides an easy-to-use interface for users to communicate with Turbine. With this package, users can effortlessly interact with Turbine without dealing with the complexities of handling arguments, inputs, outputs and files.
Features
- Fetch inputs from the standard input.
- Handle file descriptors and downloads.
- Set outputs and errors in a standardized format.
- Retrieve asset details, command-line arguments, asset schema, action schema, and proxy.
Usage
Simple examples
from swimlane_core import (get_action_schema, get_arguments, get_asset,
get_asset_schema, get_inputs, get_proxy,
process_inputs, process_outputs, set_error,
set_output)
args = get_arguments()
inputs = get_inputs()
inputs = process_inputs(inputs)
asset = get_asset()
asset_schema = get_asset_schema()
action_schema = get_action_schema()
http_proxy = get_proxy()
resp = process_outputs(resp)
set_output(resp)
set_error(e)
from swimlane_core import process_inputs
raw_inputs = {
"file": "an id",
"file_name": "sample.txt"
}
processed_inputs = process_inputs(raw_inputs)
print(processed_inputs)
raw_inputs = {
"file": "a base64",
"file_name": "sample.txt"
}
from swimlane_core import process_outputs
raw_outputs = {
"file": b"file content",
"file_name": "sample.txt"
}
processed_outputs = process_outputs(raw_outputs)
print(processed_outputs)
raw_inputs = {
"file": "a file id",
"file_name": "sample.txt"
}
Advanced
The package provides a simple facade, you can access the underling classes for complex workflows or modifying the behavior of the package.
from swimlane_core import FileDescriptor, InputHandler, OutputHandler
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
swimlane_core-1.0.0.tar.gz
(4.3 kB
view details)
Built Distribution
File details
Details for the file swimlane_core-1.0.0.tar.gz
.
File metadata
- Download URL: swimlane_core-1.0.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.2 Linux/6.2.0-1011-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dba5ac8f5bf05c195fe3f9560f4b90bf465c48045e37500d61f288d6994d3436 |
|
MD5 | da21389c8eb7aa3d1b508dbcc3e13664 |
|
BLAKE2b-256 | 9f299fbadb826d877782c970274aedc100e36f9d2e98475745b68fe207be060c |
File details
Details for the file swimlane_core-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: swimlane_core-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.2 Linux/6.2.0-1011-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af22c064690a0a4d1a68a73a9bb581f8ade3fa5451cbdd1035b1e6e3b8199a5f |
|
MD5 | 2b74b51510fd10926740c5ef7cfdfc77 |
|
BLAKE2b-256 | 4c0adc3c67eebd3dc886514aa085d498276f837702d847caa7258f6c49f1401d |