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 the SDK

python3 app.py --standalone --action=sample_function paramname=World

Example with Liquid and the Shuffle Tools app and the "repeat back to me" function

python3 app.py --standalone --action=repeat_back_to_me --call=lol

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

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.8.tar.gz (42.7 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.8-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shuffle_sdk-0.0.8.tar.gz
  • Upload date:
  • Size: 42.7 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.8.tar.gz
Algorithm Hash digest
SHA256 8b757ca7a09e5bd0c629c276229f0687114fb7d002544c321670bd2cf9476b18
MD5 c6613dce337f5585f2fd8e039c2ee702
BLAKE2b-256 60afbb410b047ea54cea027aac482c5ca7a679538d49038b50200ec3250dc87a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shuffle_sdk-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 43.3 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 110d18a434e9a1aff9e81e09af89c8ebd76ece3db7829b76ed1ac0a1374c4d15
MD5 4dd66913a0654af58d4ec91b55d1ff1c
BLAKE2b-256 2836fc3ba5e690fa1d5b63274deb0b0ffb0104c7d696d40d8292434ce1433423

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