Ardoqpy - a Python client for The Ardoq REST API
Description
Ardoqpy is a thin client library for the Ardoq REST API. It consists of 3 clients
- ArdoqClient
- thin client for the rest-api
- ArdoqSyncClient
- subclass of ArdoqClient
- maintains a cache of aggregated workspace information
- overrides write operations
- only create components and references if they are not already in the cache
- update cache for create and update operations
- cache hit is based on
- component: name, typeId
- NB: name match is CASE_INSENSITIVE
- reference: source, target, and type
- component: name, typeId
- overriders find_component (comp_name)
- loads aggregated workspace to cache if its not present
- finds component based on either of the following
- name: substring or exact match
- fieldname == fieldvalue (you need to ensure the types can handle equivalence)
- fieldname, if not None, is checked first
- can be run in simulate mode which updates the report but does not execute write operations in ardoq
- Ardoq V2 Client
- this is a copy of the client provided by ardoq in their developer portal
- v2 api functionality can be used from this client or built into the original ArdoqClient
Documentation
(see the test client for examples)
ArdoqClient Import Usage
from ardoqpy import ArdoqClient
ArdoqClient Implemented:
- workspace
- get all
- summary=True is undocumented in the REST docs but returns stats for workspaces
- get by ID
- get by ID aggregated
- create workspace
- delete
- create folder
- move workspace to folder
- get all
- component
- get by ID
- get all for workspace
- create
- delete
- update
- find by name in workspace
- find by field_name / field_value in workspace
- reference
- get all for workspace
- get by ID
- create
- update
- delete
- tag
- get by ID
- get all for workspace
- create
- update
- delete
- model
- get by ID
- get all models and templates
- print model to get IDs for component and reference types
- find reference_type by name
- find component_type by name
- folder
- create
- get by ID and all folders
- util
- pprint
- pretty print responses from ardoq calls
- pprint
ArdoqSyncClient Import Usage
from ardoqpy_sync import ArdoqSyncClient
ardoq = ArdoqSyncClient(hosturl=host, token=token)
ardoqsim = ArdoqSyncClient(hosturl=host, token=token, simulate=True)
ArdoqSyncClient Implemented:
- all interfaces from ArdoqClient
- component
- create
- cache check is based on name attribute only (case insensitive)
- update
- create
- reference
- create
- cache check is based on source, target, and type attributes
- update
- create
Installation
pip install ardoqpy
Dependencies
- Python 3
- Requests - ardoqpy uses requests package for http requests
Quick Start
To 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 client
or from the console
from 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()
Changelog
-
202401
- add get reference for v2 client
- added v2 api client. This is a copy of the one provided by ardoq on the developer portal
-
202307
- added workspace and workspaces endpoints for v2 client
-
202307
- added del and update tag
-
202303
- added audit log for support for components created, updated, deleted, and skipped due to cache_hit
-
202211
- added support for Ardoq v2 REST API. Only for the ArdoqClient (not SyncClient)
-
202207
- add find_reference_type to return reftype definition from the metamodel for a workspace
- add find_component_type to return comptype definition from the metamodel for a workspace. Checks full hierarchy
-
202204
- add print_model to print component and reference IDs
-
20220228
- add PR to include references in get_component function
- fixed bug in ardoq_sync when logging ref without displayText
-
20220212
- deprecated org parameter
- removed problem with slash on url
- change get all components in ws to search operation. In line with public API docs
-
20220131
- fixed bug in SyncClient when searching for references in a WS without refs
-
20220122
- changed get_model. calling without ws_id now returns all models
- added get_folder. returns all folders if no folder_id
-
20211107
- improve simulation mode
- added cache_miss_comps and cache_miss_refs lists to capture items found in ardoq that are no longer in the source systems
-
20210717
- Added simulate option to SyncClient to simulate write operations to update the report without modifying ardoq
-
20210420
- Fixed PyPy support
-
20170125
- Added pip and fields creation support.
-
20160618
- bug and feature improvements
- first version of the sync client
-
20160402
- Initial dev
TODO
- complete the full REST-API for fields
License
The ardoq-python-client is licensed under the MIT License
See LICENSE.md
Metadata
Release files for ardoqpy 0.8.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ardoqpy-0.8.4.tar.gz | 15.0 kB | Without provenance | Details for ardoqpy-0.8.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ardoqpy-0.8.4-py3-none-any.whl | Python 3 | none | any | Details for ardoqpy-0.8.4-py3-none-any.whl |
Total release size: 29.0 kB
Release files / ardoqpy-0.8.4.tar.gz
| Download URL | ardoqpy-0.8.4.tar.gz |
|---|---|
| Size | 15.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53c36bab832bccbcc320bce99e94ddad5d6e691316b42f3900f74bc6cf2e5c70
|
|
BLAKE2b-256 checksum How to use checksums |
ae5051909d04ae96085643be78bebd20d348cec7ab3b065b9d97b227c7cca552
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.1
|
Release files / ardoqpy-0.8.4-py3-none-any.whl
| Download URL | ardoqpy-0.8.4-py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d59e42bf624171ba6926e4db21a980fc3ee0af3fbc6a03e9103803ae54afefbe
|
|
BLAKE2b-256 checksum How to use checksums |
01a18f2bfca93139b31f6e0c249e5ec33d73a73643f6fdfb212896fceec31aa1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.1
|
Security for ardoqpy 0.8.4
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.