Skip to main content

The SDK used for Shuffle

Project description

Shuffle 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 __init__(self):
        pass

    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

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"))'

Example LLM inference with the Shuffle-AI app. Supports GPU and requires ollama installed and serving.

python3 app.py --standalone --action=run_llm 'question=convert the following data into a python list of valid ips: 12.3.4.4'

If successful, the output of the function will show in your CLI.

Building a fully functional Shuffle App

Look at the documentation on our website

Adding new Liquid filters

Add a function along these lines:

@shuffle_filters.register
def md5(a):
    a = str(a)
    return hashlib.md5(a.encode('utf-8')).hexdigest()

This can be used as {{ "string" | md5 }}, where "string" -> the a parameter of the function

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

shuffle_sdk-0.0.10.tar.gz (43.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shuffle_sdk-0.0.10-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file shuffle_sdk-0.0.10.tar.gz.

File metadata

  • Download URL: shuffle_sdk-0.0.10.tar.gz
  • Upload date:
  • Size: 43.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for shuffle_sdk-0.0.10.tar.gz
Algorithm Hash digest
SHA256 ac0e34f0a6779064e924f7287c95e3a1a828c02f7a4d5fd2f8431b946479fe9a
MD5 842982b1547e1c7c7a789014d0ff8623
BLAKE2b-256 3fae87e6fcb664324a0af92010a8c193ac892c80fd6dfe75d13f0f60b31f864a

See more details on using hashes here.

File details

Details for the file shuffle_sdk-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: shuffle_sdk-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for shuffle_sdk-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 5b4bfe38d86b2bcce2e1ee465a46d776f3f30f4a0f3f4a07d68d3a2bb0c9d5cc
MD5 08b479102d10638d8745a336095750a8
BLAKE2b-256 a1d89321627d78373ea5b41ba2ce21d8051121ce3948a349a66de2acd15713ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page