# 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
```python
from swimlane_core import (get_action_schema, get_arguments, get_asset,
get_asset_schema, get_inputs, get_proxy,
process_inputs, process_outputs, get_error,
get_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)
output = get_output(resp)
print(output, sep="")
error_output = get_error(req_err, is_http_error=True)
print(error_output, file=sys.stderr)
```
```python
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"
}
```
```python
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.
```python
from swimlane_core import FileDescriptor, InputHandler, OutputHandler
```
Raw data
{
"_id": null,
"home_page": "https://github.com/swimlane/swimlane_core",
"name": "swimlane_core",
"maintainer": "Swimlane",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "connector,swimlane,connectors",
"author": "Swimlane",
"author_email": "support@swimlane.com",
"download_url": "https://files.pythonhosted.org/packages/0f/41/b3c8822c397c5cf61fe20ffe3f708fb62f73a90ae6e5f75eef19530ba2cf/swimlane_core-1.1.1.tar.gz",
"platform": null,
"description": "# Swimlane Core\n\nThe 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.\n\n\n## Features\n\n* Fetch inputs from the standard input.\n* Handle file descriptors and downloads.\n* Set outputs and errors in a standardized format.\n* Retrieve asset details, command-line arguments, asset schema, action schema, and proxy.\n\n## Usage\n\n### Simple examples\n\n```python\nfrom swimlane_core import (get_action_schema, get_arguments, get_asset,\n get_asset_schema, get_inputs, get_proxy,\n process_inputs, process_outputs, get_error,\n get_output)\n\n\nargs = get_arguments()\ninputs = get_inputs()\ninputs = process_inputs(inputs)\nasset = get_asset()\nasset_schema = get_asset_schema()\naction_schema = get_action_schema()\nhttp_proxy = get_proxy()\nresp = process_outputs(resp)\noutput = get_output(resp)\nprint(output, sep=\"\")\nerror_output = get_error(req_err, is_http_error=True)\nprint(error_output, file=sys.stderr)\n```\n\n```python\nfrom swimlane_core import process_inputs\n\n\nraw_inputs = {\n \"file\": \"an id\",\n \"file_name\": \"sample.txt\"\n}\n\nprocessed_inputs = process_inputs(raw_inputs)\nprint(processed_inputs)\n\nraw_inputs = {\n \"file\": \"a base64\",\n \"file_name\": \"sample.txt\"\n}\n\n```\n\n```python\nfrom swimlane_core import process_outputs\n\n\nraw_outputs = {\n \"file\": b\"file content\",\n \"file_name\": \"sample.txt\"\n}\n\nprocessed_outputs = process_outputs(raw_outputs)\nprint(processed_outputs)\n\nraw_inputs = {\n \"file\": \"a file id\",\n \"file_name\": \"sample.txt\"\n}\n\n```\n\n### Advanced\n\nThe package provides a simple facade, you can access the underling classes for complex workflows or modifying the behavior of the package.\n\n\n```python\nfrom swimlane_core import FileDescriptor, InputHandler, OutputHandler\n```",
"bugtrack_url": null,
"license": "",
"summary": "This package provides an abstraction layer between Swimlane and Python Scripts.",
"version": "1.1.1",
"project_urls": {
"Homepage": "https://github.com/swimlane/swimlane_core",
"Repository": "https://github.com/swimlane/swimlane_core"
},
"split_keywords": [
"connector",
"swimlane",
"connectors"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ce1d40ec513f23f9e8ee5d6bdf623e2d686f263bb96dc63c676bf0294bb84893",
"md5": "5efd40caa694ca8aed2d4ad4b68e7363",
"sha256": "f3892d92330f88365c019624faf439c15acbf96ca3bd2bfc7f8c7a82a4a3ade2"
},
"downloads": -1,
"filename": "swimlane_core-1.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5efd40caa694ca8aed2d4ad4b68e7363",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 5114,
"upload_time": "2024-01-24T23:23:32",
"upload_time_iso_8601": "2024-01-24T23:23:32.117315Z",
"url": "https://files.pythonhosted.org/packages/ce/1d/40ec513f23f9e8ee5d6bdf623e2d686f263bb96dc63c676bf0294bb84893/swimlane_core-1.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0f41b3c8822c397c5cf61fe20ffe3f708fb62f73a90ae6e5f75eef19530ba2cf",
"md5": "eefa44ee0e1a03aa8192b57aaff8a173",
"sha256": "18f5da19b8370bfdb4f035eeb449cdc6f3df371d0d76561bfa86ff535e352ada"
},
"downloads": -1,
"filename": "swimlane_core-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "eefa44ee0e1a03aa8192b57aaff8a173",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 4137,
"upload_time": "2024-01-24T23:23:33",
"upload_time_iso_8601": "2024-01-24T23:23:33.558657Z",
"url": "https://files.pythonhosted.org/packages/0f/41/b3c8822c397c5cf61fe20ffe3f708fb62f73a90ae6e5f75eef19530ba2cf/swimlane_core-1.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-24 23:23:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "swimlane",
"github_project": "swimlane_core",
"github_not_found": true,
"lcname": "swimlane_core"
}