The SDK used for Shuffle
Actively maintained. Last release 3 months ago, commits in 19 of the last 26 weeks. A safe choice.
pip install shuffle-sdkShuffle SDK
This is the SDK used for app development, testing and production of ALL apps in Shuffle. Works with manual runs, Docker, k8s, cloud serverless.
Released under Python pip for usage outside of Shuffle
Python apps: https://github.com/shuffle/python-apps All apps: https://shuffler.io/search
Usage with Shuffle
Refer to the Shuffle App Creation docs
Build
docker build . -t shuffle/shuffle:app_sdk
Download
pip install shuffle_sdk
Usage
from shuffle_sdk import AppBase
class Example(AppBase):
def sample_function(self, paramname):
return f"Hello {paramname}"
if __name__ == "__main__":
Example.run()
Testing Shuffle Apps
With the above function as an example
python3 app.py --standalone --action=sample_function paramname=World
NOT REQUIRED: These are reserved parameters, allowing you to set variables for testing such as local backends to upload into Shuffle during tests:
--shuffle_url="http://custom_backend_url"
--shuffle_authorization="auth"
--shuffle_executionid="execution_id"
Example wit Shuffle Tools+Liquid and the Shuffle Tools app and the "repeat back to me" function
python3 app.py --standalone --action=repeat_back_to_me '--call={{ "hello" | replace: "o", "lol" }}'
Example using Shuffle Tools Shuffle actions within the "execute_python" function to get emails from Outlook (app.py)
python3 app.py --standalone --action=execute_python 'code=print(shuffle.run_app(app_id="accdaaf2eeba6a6ed43b2efc0112032d", action="get_emails"))'