Skip to content

Commit

Permalink
Fixed Singul to work with Shuffle better by using Execution auth for …
Browse files Browse the repository at this point in the history
…single actions
  • Loading branch information
frikky committed Jan 24, 2025
1 parent 2b59dd3 commit c53423c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='shufflepy', # Name of the package
version='0.0.6', # Version number
version='0.0.7', # Version number
description='Use Singul to connect to API with a single line of code',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
Expand Down
Binary file modified shufflepy/__pycache__/module.cpython-312.pyc
Binary file not shown.
10 changes: 7 additions & 3 deletions shufflepy/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Singul():

# High default timeout due to autocorrect possibly taking time
def __init__(self, auth="", url="https://shuffler.io", verify=True, timeout=60):
def __init__(self, auth="", url="https://shuffler.io", execution_id="", verify=True, timeout=60):
if not url:
raise ValueError("url is required")

Expand All @@ -19,7 +19,8 @@ def __init__(self, auth="", url="https://shuffler.io", verify=True, timeout=60):

self.config = {
"url": url,
"auth": auth
"auth": auth,
"execution_id": execution_id,
}

self.org_id = ""
Expand Down Expand Up @@ -66,7 +67,10 @@ def run_app(self, app_id="", action="", auth_id="", parameters={}, org_id="", au
parsedheaders["Org-Id"] = org_id

if not isinstance(parameters, dict) and not isinstance(parameters, list):
raise ValueError("parameters must be a dictionary")
raise ValueError("Parameters must be a dictionary of key:values or list of [{name: name, value:value}]")

if self.config["execution_id"]:
parsedurl += f"?execution_id={self.config['execution_id']}&authorization={self.config['auth']}"

# Check if parameters is a dict. If it is is, map key: value to parameters
params = []
Expand Down

0 comments on commit c53423c

Please sign in to comment.