Package: ardoqpy
Ardoqpy - a Python client for The Ardoq REST APIDescriptionArdoqpy is a thin client library for theArdoqREST API.
It consists of 3 clientsArdoqClientthin client for the rest-apiArdoqSyncClientsubclass of ArdoqClientmaintains a cache of aggregated workspace informationoverrides write operationsonly create components and references if they are not already in the cacheupdate cache for create and update operationscache hit is based oncomponent: name, typeIdNB: name match is CASE_INSENSITIVEreference: source, target, and typeoverriders find_component (comp_name)loads aggregated workspace to cache if its not presentfinds component based on either of the followingname: substring or exact matchfieldname == fieldvalue (you need to ensure the types can handle equivalence)fieldname, if not None, is checked firstcan be run in simulate mode which updates the report but does not execute write operations in ardoqArdoq V2 Clientthis is a copy of the client provided by ardoq in their developer portalv2 api functionality can be used from this client or built into the original ArdoqClientDocumentation(see the test client for examples)ArdoqClient Import Usagefrom ardoqpy import ArdoqClientArdoqClient Implemented:workspaceget allsummary=True is undocumented in the REST docs but returns stats for workspacesget by IDget by ID aggregatedcreate workspacedeletecreate foldermove workspace to foldercomponentget by IDget all for workspacecreatedeleteupdatefind by name in workspacefind by field_name / field_value in workspacereferenceget all for workspaceget by IDcreateupdatedeletetagget by IDget all for workspacecreateupdatedeletemodelget by IDget all models and templatesprint model to get IDs for component and reference typesfind reference_type by namefind component_type by namefoldercreateget by ID and all foldersutilpprintpretty print responses from ardoq callsArdoqSyncClient Import Usagefrom ardoqpy_sync import ArdoqSyncClient
ardoq = ArdoqSyncClient(hosturl=host, token=token)
ardoqsim = ArdoqSyncClient(hosturl=host, token=token, simulate=True)ArdoqSyncClient Implemented:all interfaces from ArdoqClientcomponentcreatecache check is based on name attribute only (case insensitive)updatereferencecreatecache check is based on source, target, and type attributesupdateInstallationpip install ardoqpyDependenciesPython 3Requests- ardoqpy uses requests package for http requestsQuick StartTo get started, simply install ardoqpy, create an ArdoqClient object and call methods:edit `ardoq.cfg` to include your API token
make sure `ardoqpy.py` opens your `ardoq.cfg`configuration file
use `testclient.py`as a basis for your own clientor from the consolefrom ardoqpy import ArdoqClient
ardoq = ardoqpy.ArdoqClient(hosturl='https://YOURORG.ardoq.com', token='YOURTOKEN')
# to use v2 API
ardoq = ardoqpy.ArdoqClient(hosturl='https://YOURORG.ardoq.com', token='YOURTOKEN', version='v2')
ardoq.get_workspaces()Changelog202401add get reference for v2 clientadded v2 api client. This is a copy of the one provided by ardoq on the developer portal202307added workspace and workspaces endpoints for v2 client202307added del and update tag202303added audit log for support for components created, updated, deleted, and skipped due to cache_hit202211added support for Ardoq v2 REST API. Only for the ArdoqClient (not SyncClient)202207add find_reference_type to return reftype definition from the metamodel for a workspaceadd find_component_type to return comptype definition from the metamodel for a workspace. Checks full hierarchy202204add print_model to print component and reference IDs20220228add PR to include references in get_component functionfixed bug in ardoq_sync when logging ref without displayText20220212deprecated org parameterremoved problem with slash on urlchange get all components in ws to search operation. In line with public API docs20220131fixed bug in SyncClient when searching for references in a WS without refs20220122changed get_model. calling without ws_id now returns all modelsadded get_folder. returns all folders if no folder_id20211107improve simulation modeadded cache_miss_comps and cache_miss_refs lists to capture items found in ardoq that are no longer in the source systems20210717Added simulate option to SyncClient to simulate write operations to update the report without modifying ardoq20210420Fixed PyPy support20170125Added pip and fields creation support.20160618bug and feature improvementsfirst version of the sync client20160402Initial devTODOcomplete the full REST-API for fieldsLicenseThe ardoq-python-client is licensed under the MIT LicenseSee LICENSE.md