Skip to content
Run WayScript programs from Python
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
.github/ISSUE_TEMPLATE Update issue templates (#1) Apr 17, 2019
tests
wayscript
.gitignore
LICENSE.txt
README.md
setup.py

README.md

WayScript Python SDK

PyPI version CircleCI Status

A new way to build software.

  • WayScript gives you flexible building blocks to seamlessly integrate, automate and host tools in the cloud. Unlock new potential with drag and drop programming.

  • Instantly connect to hundreds of datasets including GitHub, Twitter, databases, ecommerce data, or build your own integration. WayScript can read data from Excel, Google Sheets, and an evergrowing list of third-party APIs.

  • Seamlessly migrate to the cloud: Generate interfaces, instantly share, and run via event-based triggering.

Installation

pip install wayscript

Basic Usage

  1. Get the API Key from your WayScript user profile page

  2. Run your WayScript programs from your Python code:

from wayscript import WayScript

api_key = 'YOUR_API_KEY'
wayscript = WayScript( api_key )

# Run a program by id
program_id = 1234
wayscript.run_program( program_id )

# Pass variables to a program (optional)
variables = [ 'one', 'two', 'three' ]
wayscript.run_program( program_id, variables = variables )

# Run a specific function within your program (optional)
function = 'My Function'
wayscript.run_program( program_id, variables = variables, function = function )

# Run a program asynchronously (optional)
wayscript.run_program( program_id, run_async = True )
wayscript.run_program( program_id, variables = variables, function = function, run_async = True )

# Get the response from the server
response = wayscript.run_program( program_id )

⭐ In order to run a program using the WayScript Python API, you must first add an active Webhook Trigger to that program.

Running a specific function

  • The function you specify MUST have an active Webhook Trigger.
  • If you do not specify a function name in your request and your program has one function with a Webhook Trigger, the function with the Webhook Trigger will run.
  • If you do not specify a function name in your request and your program has multiple functions with Webhook Triggers, you will be asked to specify which function you would like to run.

Run a WayScript program from command line

WS_API_KEY="YOUR_API_KEY"
PROGRAM_ID=1234
ARGUMENT="whatever"
FUNCTION="My Function"

python -c "from wayscript import WayScript; WayScript('$WS_API_KEY').run_program($PROGRAM_ID, '$ARGUMENT', '$FUNCTION')"

If you don't want to use Python on the command line, you can use curl. (See the WayScript REST API documentation.)

You can’t perform that action at this time.