No project description provided
Project description
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...
Project details
Release history Release notifications | RSS feed
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 hashes)