Skip to main content

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-1.0.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cluedin-1.0.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file cluedin-1.0.0.tar.gz.

File metadata

  • Download URL: cluedin-1.0.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/22.4.0

File hashes

Hashes for cluedin-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5dfee385d8b8843c5dd69a52273c7d7d0a81ac7b164e1d3523725a48face1d57
MD5 ed885dd623c7eb602c8406eaa79f4e0d
BLAKE2b-256 67daef5639b686afcce0316e9d520e13a888ff33a73c613a32e273a8c2607095

See more details on using hashes here.

File details

Details for the file cluedin-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cluedin-1.0.0-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

Hashes for cluedin-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37e94d5a710a41d599a5bef629a4f1026d0b0d88ae16ceaf567e1cb1d9787a86
MD5 8bd475b6d0ed574593fad469ff03c1d6
BLAKE2b-256 5eec6c37151a37b6c4b4287c22b40e2ad63871e3751d23e96d08f7a58c24ca97

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page