No project description provided
Project description
Python Functions for Alteryx Workflow Management
This document explains two Python functions designed to manage Alteryx workflows through their API:
##1. generate_oauth_token(certificate_location, access_token_url, username, password, print_access_token):##
This function acquires an OAuth 2.0 access token necessary for interacting with the Alteryx API.
Parameters:
- certificate_location (str): Path to the certificate file used for verifying the API endpoint.
- access_token_url (str): URL for obtaining the access token.
- username (str): Username for authentication.
- password (str): Password for authentication.
- print_access_token (bool): Set to True to print the obtained access token.
Return Value:
str: The access token on successful retrieval, otherwise None.
##2. trigger_alteryx_workflow(certificate_location, access_token_url, url, username, password, print_access_token)##
This function triggers an Alteryx workflow using the obtained access token.
Parameters:
- certificate_location (str): Path to the certificate file used for verifying the API endpoint.
- access_token_url (str): URL for obtaining the access token.
- url (str): URL of the Alteryx workflow endpoint to trigger.
- username (str): Username for authentication.
- password (str): Password for authentication.
- print_access_token (bool): Set to True to print the obtained access token.
Return Value:
int: HTTP status code of the trigger request. 200 indicates successful workflow triggering.
Example Usage:
# Replace with your specific values
certificate_location = "path/to/certificate.pem"
access_token_url = "https://your-alteryx-server/oauth2/token"
url = "https://your-alteryx-server/api/workflows/123/run"
username = "your_username"
password = "your_password"
print_access_token = True
# Obtain access token
access_token = generate_oauth_token(certificate_location, access_token_url, username, password, print_access_token)
# Trigger workflow
status_code = trigger_alteryx_workflow(certificate_location, access_token_url, url, username, password, print_access_token)
if status_code == 200:
print("Workflow triggered successfully!")
else:
print(f"Error triggering workflow: {status_code}")
#Additional Notes:
- Ensure you have the requests and json libraries installed (pip install requests json).
- Replace the placeholder values with your actual Alteryx configuration details.
- This example demonstrates basic usage. Error handling and more robust implementation might be required in production environments.
I hope this README clarifies the usage of these functions for managing Alteryx workflows through Python. Feel free to ask if you have any further questions.
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 Distributions
Built Distribution
File details
Details for the file AlteryxConnector-0.2-py3-none-any.whl
.
File metadata
- Download URL: AlteryxConnector-0.2-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 773d08dfe338f47d006d96817f8ce13af0fa50c9e343411eb110dd69267e1969 |
|
MD5 | c1520b81a434a3cfb6ee4de0024b86bc |
|
BLAKE2b-256 | 87eb830af731471e71ea6b11df0ce312f43534f5057646a9addad437c4659ea7 |