Connect to Alteryx Gallery using API
Project description
alteryx_gallery_py
A lightweight Python wrapper for the Alteryx gallery API.
Installation
Use the package manager pip to install alteryx_gallery_py.
pip install alteryx_gallery_py
Usage
import zipfile
import io
from alteryx_gallery_py import Subscriptions
gallery_url = "http://devalteryx.continuus-technologies.com/gallery/"
api_key = 'INSERT API KEY'
client_secret = 'INSERT API SECRET'
# Initiate Subscription Object
sub = Subscriptions(api_key, client_secret, gallery_url)
# Search for a workflow in gallery
workflows = sub.get_workflows(search="pizza survey")
pizza_app_id = workflows[0]["id"]
# Get Questions for a workflow
questions = sub.get_questions(pizza_app_id)
# Run an app
answers = [
{"name": "Question 1","value": "True"},
{"name": "Question 2","value": "Cheese"},
{"name": "Question 3","value": 150}
]
job_run = sub.create_job(pizza_app_id, questions=answers, priority="0")
# Get job status
job_status = sub.get_job(job_run["id"])
output_id = job_status["outputs"][0]["id"]
# List all jobs for an Alteryx app
all_pizza_jobs = sub.list_jobs(pizza_app_id)
# Get job output
job_output = sub.get_job_output(job_run["id"], output_id)
# Download an Alteryx Analytics App
app_package = sub.download_app(pizza_app_id)
z = zipfile.ZipFile(io.BytesIO(app_package))
z.extractall("./")
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file alteryx_gallery_py-1.0.1.tar.gz
.
File metadata
- Download URL: alteryx_gallery_py-1.0.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84b3eb8409023c6f748c03e0de5304bacaecfae76adc76cdda97fc1ea01b5657 |
|
MD5 | 0cee9ff7731964a563289c49b901c96c |
|
BLAKE2b-256 | 1e327d02f27d08085280606046e0875dee2088d1f9834577d0a4a3835c003b69 |
File details
Details for the file alteryx_gallery_py-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: alteryx_gallery_py-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21f4c96b21732c9a67ba8a71df53c60b58fa6d1e18d57d346e2bce92b77e8c6c |
|
MD5 | 4184f4344eb414d1146cefcb22a420ac |
|
BLAKE2b-256 | dfea79fe25ace4ef357d13b5797aa84fc3a78152369e36265272a4b8a22aa193 |