CluedIn
cluedin is a Python client for CluedIn API. It can help you with the following:
- getting JWT access tokens to CluedIn
- calling CluedIn REST API
- calling CluedIn GraphQL API
The use is pretty simple. First, install it from PyPi:
pip install cluedin
Next, you will need to obtain an access token:
import cluedin
context = {
"protocol": "http", # if you skip this parameter, it will fall back to `https`
"domain": "cluedin.local",
"organization": "foobar",
"user": "admin@foobar.com",
"password": "Foobar23!"
}
cluedin.load_token_into_context(context)
print(context['access_token'])
Run a GraphQL query:
query = """
query searchEntities($cursor: PagingCursor, $query: String, $pageSize: Int) {
search(query: $query, sort: DATE, cursor: $cursor, pageSize: $pageSize) {
totalResults
cursor
entries {
id
name
entityType
}
}
}
"""
variables = {
"query": "entityType:/Infrastructure/User",
"pageSize": 1
}
response = cluedin.gql.gql(context, query, variables)
Get paged results:
import numpy as np
import pandas as pd
query = """
query searchEntities($cursor: PagingCursor, $query: String, $pageSize: Int) {
search(query: $query, sort: DATE, cursor: $cursor, pageSize: $pageSize) {
totalResults
cursor
entries {
id
name
entityType
}
}
}
"""
variables = {
"query": "*",
"pageSize": 10000
}
entries = np.array([x for x in cluedin.gql.entries(context, query, variables)])
df = pd.DataFrame(entries.tolist(), columns=list(entries[0].keys()))
To be continued...
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cluedin-0.2.2.tar.gz
(2.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cluedin-0.2.2.tar.gz.
File metadata
- Download URL: cluedin-0.2.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/22.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
693281c8969c7e61b54d4e178bd7ce60501e9f55d3b587f8b595f89b626345aa
|
|
| MD5 |
a814f42a97c2d95cfa497a6119f91722
|
|
| BLAKE2b-256 |
a9e28b6cb98387a4894bcf392e91ccfa17fc07540c4eb5bec35c7e5149319412
|
File details
Details for the file cluedin-0.2.2-py3-none-any.whl.
File metadata
- Download URL: cluedin-0.2.2-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/22.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d319151be727ccf323ad86fb6d8c65864b1e43bd2f830d8b92950bd79f1f5745
|
|
| MD5 |
8bb73fa233dc664418984223a396a41d
|
|
| BLAKE2b-256 |
a11e28d1cff8bc930c34f62f3602f8c37621d2275eed36464051fd2faf08085b
|