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.1.tar.gz
(2.7 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.1.tar.gz.
File metadata
- Download URL: cluedin-0.2.1.tar.gz
- Upload date:
- Size: 2.7 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 |
72fd98407ff81316125b0aef18aa5727c98b0e59c46d9bd5b5bc8270ddb61932
|
|
| MD5 |
80725ba329dd6032cccbe20844a93eee
|
|
| BLAKE2b-256 |
b370f576fc709179e9f5e7284c1a7140fc4a229ade04dbbcf13227ab5f68f1cb
|
File details
Details for the file cluedin-0.2.1-py3-none-any.whl.
File metadata
- Download URL: cluedin-0.2.1-py3-none-any.whl
- Upload date:
- Size: 3.5 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 |
6895eeb62c474136874d488015bf10ab1faf89a5d0b1f8d4f18c08f633520c1d
|
|
| MD5 |
ee272a6258308ef38713088833713999
|
|
| BLAKE2b-256 |
ce8cc7eb4209acf3e64ca02095a1e30038471851f5bc1688f4eee25e05ed6650
|