Shuffle SDK

raw JSON →
0.0.38 verified Fri May 01 auth: no python

The Python SDK for Shuffle, an open-source SOAR (Security Orchestration, Automation, and Response) platform. Current version 0.0.38, updated irregularly. This SDK allows programmatic interaction with the Shuffle API, including actions like creating workflows, executing rules, and managing apps.

pip install shuffle-sdk
error ModuleNotFoundError: No module named 'shuffle'
cause The package is installed as 'shuffle-sdk' but import uses 'shuffle'. The package name differs from the import name.
fix
Run: pip install shuffle-sdk. Then import with: from shuffle import Shuffle
error AttributeError: module 'shuffle' has no attribute 'Shuffle'
cause Wrong import pattern: 'import shuffle' only imports the module, not the class.
fix
Use: from shuffle import Shuffle
error requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://example.com/api/v1/workflows
cause API key is invalid or missing. The SDK uses HTTP Basic Auth with the key as username and empty password.
fix
Ensure the api_key is set correctly and the base URL points to the correct Shuffle instance.
gotcha The Shuffle SDK uses HTTP Basic Auth with the API key, not Bearer tokens. Setting the wrong auth header will cause 401 errors.
fix Pass api_key as the only credential; do not set Authorization header manually.
deprecated The method 'create_workflow' in versions <0.0.30 accepted a single dict argument. In 0.0.38, it expects keyword arguments for 'name', 'description', etc.
fix Update calls to use keyword arguments: create_workflow(name='test', description='...')
gotcha The PyPI package name is 'shuffle-sdk', but the import package is 'shuffle'. This mismatch often causes confusion and ImportError.
fix Install with 'pip install shuffle-sdk' but import as 'from shuffle import Shuffle'.
gotcha API rate limits are not documented by the Shuffle server. Users have reported sudden 429 errors, especially when polling workflows quickly.
fix Implement exponential backoff retry logic for API calls.

Initialize the Shuffle client with your API key and base URL.

from shuffle import Shuffle
import os

api_key = os.environ.get('SHUFFLE_API_KEY', '')
shuffle = Shuffle(api_key=api_key, base_url='https://shuffle-api.example.com')
# Example: list workflows
workflows = shuffle.get_workflows()
print(workflows)