Skip to main content

Query and Ingestion Client for Azure using Python

Project description

#Getting started

##Installation and Import

pip install kustopy
from kustopy import KustoPyClient as kpc

###QueryClient

# Get login credential from Azure Vault
client_id = dbutils.secrets.get(scope="ce5", key="adxClientId")
client_secret = dbutils.secrets.get(scope="ce5", key="adxClientSecret")
tenant_id = dbutils.secrets.get(scope="ce5", key="adxTenantId")

# Set up the query client
query_client = kpc.QueryClient(cluster='https://sample.kusto.windows.net/',
                               database='confidential-satanalytics-sample',
                               client_id=client_id,
                               client_secret=client_secret,
                               tenant_id=tenant_id,
                               truncation=False)
# Query all tables available in database
query_client.get_table_names()
# Write kusto queries to get data into pandas dataframe
query_client.query_to_df('SampleTable | take 100 | where fruit=="apple"')

###IngestionClient

# Get login credential from Azure Vault
client_id = dbutils.secrets.get(scope="ce5", key="adxClientId")
client_secret = dbutils.secrets.get(scope="ce5", key="adxClientSecret")
tenant_id = dbutils.secrets.get(scope="ce5", key="adxTenantId")

# Set up the ingestion client
query_client = kpc.IngestionClient(cluster='https://sample.kusto.windows.net/',
                                   database='confidential-satanalytics-sample',
                                   client_id=client_id,
                                   client_secret=client_secret,
                                   tenant_id=tenant_id,
                                   truncation=False)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kustopy-1.0.20.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

kustopy-1.0.20-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file kustopy-1.0.20.tar.gz.

File metadata

  • Download URL: kustopy-1.0.20.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.11

File hashes

Hashes for kustopy-1.0.20.tar.gz
Algorithm Hash digest
SHA256 a40b61d74eafb0ad59f3932becd12031ff3855c6c14979cb54306c42ab8be28a
MD5 b978630014eaa90a6e5ccd60b28b0c49
BLAKE2b-256 223de5406e71a1b77dc62f48b62fbe77e7595e88ed32357d31e27c22e072029e

See more details on using hashes here.

File details

Details for the file kustopy-1.0.20-py3-none-any.whl.

File metadata

  • Download URL: kustopy-1.0.20-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.11

File hashes

Hashes for kustopy-1.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 f8eb0dc632ed0acd218824f10d2ead9cf82458eff029c5e75bd3aa3d9467ec0e
MD5 33fdf86ad59a308f11b6d37393e5fd9c
BLAKE2b-256 ebb5f6f3a741f5e45d69ea219fcad5d1ad2947805e3468344389c8b4c8f17814

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