dkutils.alteryx_api.gallery_client module¶
- class dkutils.alteryx_api.gallery_client.GalleryClient(api_location: str, api_key: str, api_secret: str)[source]¶
Bases:
object
Client object for invoking calls to the Alteryx Gallery API. See https://gallery.alteryx.com/api-docs/ for more information
- Parameters
api_location (str) – The base URL for the Gallery server
api_key (str) – The api key used to authenticate access to the Gallery API. Then can be found in the Keys section of account settings on the Alteryx Gallery.
api_secret (str) – The api secret used to authenticate access to the Gallery API. Then can be found in the Keys section of account settings on the Alteryx Gallery.
- execute_workflow(app_id: str) dkutils.alteryx_api.gallery_client.JobInfo [source]¶
Queue an app execution job.
- Returns
Information about the job
- Return type
- execute_workflow_and_wait(app_id: str, sleep_seconds: int = 300, max_wait_seconds: int = 3) dkutils.alteryx_api.gallery_client.JobInfo [source]¶
Queue an app execution job and wait for the job to complete.
- Raises
GalleryException – if job times out
- Returns
Information about the job
- Return type
- get_all_workflows() List[dkutils.alteryx_api.gallery_client.Workflow] [source]¶
- Returns
A list of all workflows
- Return type
list or None
Notes
Only Gallery Curators(Admins) can use this API endpoint.
- get_job_status(job_id: str) dkutils.alteryx_api.gallery_client.JobInfo [source]¶
Retrieves the job and its current state
- Returns
Information about the job and its current state
- Return type
- get_subscription_workflows() List[dkutils.alteryx_api.gallery_client.Workflow] [source]¶
- Returns
A list of workflows
- Return type
list or None
Notes
Subscription is tied to API key. You cannot request workflows for any other subscription without that subscription’s key.
- property api_key¶
- property api_location¶
- property api_secret¶
- class dkutils.alteryx_api.gallery_client.JobInfo(id: str, appId: str, createDate: datetime.datetime, status: str, disposition: str, outputs: dict, messages: List[dkutils.alteryx_api.gallery_client.JobInfoMessage], priority: int, workerTag: str, runWithE2: bool)[source]¶
Bases:
object
- appId: str¶
- createDate: datetime.datetime¶
- disposition: str¶
- id: str¶
- messages: List[dkutils.alteryx_api.gallery_client.JobInfoMessage]¶
- outputs: dict¶
- priority: int¶
- runWithE2: bool¶
- status: str¶
- workerTag: str¶
- class dkutils.alteryx_api.gallery_client.JobInfoMessage(status: int, text: str, toolId: int)[source]¶
Bases:
object
- status: int¶
- text: str¶
- toolId: int¶
- class dkutils.alteryx_api.gallery_client.JobInfoStatus(value)[source]¶
Bases:
enum.Enum
An enumeration.
- APPEND_OR_UPDATE_OUTPUT_CONFIG_XML = 18¶
- BROWSE_EVERYWHERE_FILENAME_EX = 71¶
- BROWSE_EVERY_WHERE_FILENAME = 70¶
- CACHE_TEMP_FILE = 16¶
- CHOOSE_FROM_MULTIPLE = 30¶
- COMPLETE = 4¶
- CONNECT_INFO_XML = 17¶
- DISABLED = 7¶
- DOCUMENT_TEMP_FILE = 13¶
- ERROR = 3¶
- FIELD_CONVERSION_ERROR = 5¶
- FIELD_CONVERSION_ERROR_LIMIT = 6¶
- FILE_DEPENDENCY = 15¶
- FILE_INPUT = 8¶
- FILE_OUTPUT = 9¶
- INFO = 1¶
- INSIGHT_UPDATE = 100¶
- LOW_DISK_WARNING = 20¶
- OUTPUT_FIELDNAMES = 40¶
- OUTPUT_RECORD = 41¶
- PREVIEW_FAIL = 31¶
- RECORD_COUNT_AND_SIZE = 50¶
- RELEASE_ASSET_REQUESTED = 92¶
- REQUEST_AUTO_CONFIG_REFRESH = 12¶
- SAFE_MODE_ERROR = 21¶
- SHARED_ASSET_CREATED = 90¶
- TEMP_DIRECTORY = 14¶
- UPDATE_OUTPUT_CONFIG_XML = 11¶
- UPDATE_OUTPUT_META_INFO_XML = 10¶
- WARNING = 2¶
- class dkutils.alteryx_api.gallery_client.MetaInfo(name: str, description: str, author: str, copyright: str, url: str, urlText: str, outputMessage: str, noOutputFilesMessage: str)[source]¶
Bases:
object
- author: str¶
- copyright: str¶
- description: str¶
- name: str¶
- noOutputFilesMessage: str¶
- outputMessage: str¶
- url: str¶
- urlText: str¶
- class dkutils.alteryx_api.gallery_client.Workflow(id: str, subscriptionId: str, public: bool, runDisabled: bool, packageType: str, uploadDate: str, fileName: str, metaInfo: dkutils.alteryx_api.gallery_client.MetaInfo, isChained: bool, version: int, runCount: int, workerTag: str, isE2: bool)[source]¶
Bases:
object
- fileName: str¶
- id: str¶
- isChained: bool¶
- isE2: bool¶
- packageType: str¶
- public: bool¶
- runCount: int¶
- runDisabled: bool¶
- subscriptionId: str¶
- uploadDate: str¶
- version: int¶
- workerTag: str¶
- dkutils.alteryx_api.gallery_client.nested_dataclass_decorator(*args, **kwargs)[source]¶
- Returns
A decorator that can be used on dataclasses that contain nested dataclasses. Use of this decorator on a dataclass
which contains a field that is also a dataclass will allow the class to be instantiated via a dictionary which
also contains a nested dictionary for the the field that is a dataclass. For example if you had the following
declaration
@dataclass
class A – a: int b: str
@dataclass
class B – c: str d: A
You would normally need to construct an instance of Class B as follows
a = A({“a” (1, “b”: “one”}))
b = B({“c” (“see”, “d”: a}))
You need to construct an instance of A before creating B. Using this decorator on B will instead let you do the
following
b = B({“c” (“see”, “d”: {“a”: 1, “b”: “one”}})