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.
Metadata
Release files for AlteryxConnector 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| AlteryxConnector-0.3-py3-none-any.whl | Python 3 | none | any | Details for AlteryxConnector-0.3-py3-none-any.whl |
Release files / AlteryxConnector-0.3-py3-none-any.whl
| Download URL | AlteryxConnector-0.3-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1453a2ea1b04a16865ae07b05b2644504111d8e86c39e2d2fa895429c2e62e4b
|
|
BLAKE2b-256 checksum How to use checksums |
545a54064d61f9a207a8b8e1b97c021403f6d140334b2abb7f1a154cdfd17901
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Security for AlteryxConnector 0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.