Kusto Data Client
Project Links
Meta
Author: Microsoft Corporation
Classifiers
Development Status
- 4 - Beta
Intended Audience
- Developers
Topic
- Software Development
Programming Language
- Python :: 3.8
- Python :: 3.8
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
License
- OSI Approved :: MIT License
Microsoft Azure Kusto Library for Python
Overview
.. code-block:: python
from azure.kusto.data import KustoClient, KustoConnectionStringBuilder
cluster = "<insert here your cluster name>"
client_id = "<insert here your AAD application id>"
client_secret = "<insert here your AAD application key>"
authority_id = "<insert here your AAD tenant id>"
kcsb = KustoConnectionStringBuilder.with_aad_application_key_authentication(cluster, client_id, client_secret, authority_id)
# It is a good practice to re-use the KustoClient instance, as it maintains a pool of connections to the Kusto service.
# This sample shows how to create a client and close it in the same scope, for demonstration purposes.
with KustoClient(kcsb) as client:
db = "Samples"
query = "StormEvents | take 10"
response = client.execute(db, query)
for row in response.primary_results[0]:
print(row[0], " ", row["EventType"])
Kusto Python Client Library provides the capability to query Kusto clusters using Python. It is Python 3.x compatible and supports all data types through familiar Python DB API interface.
It's possible to use the library, for instance, from Jupyter Notebooks <http://jupyter.org/>.
which are attached to Spark clusters,
including, but not exclusively, Azure Databricks <https://azure.microsoft.com/en-us/services/databricks/>. instances.
Async Client
Kusto now provides an asynchronous client for queries.
To use the client, first install the package with the "aio" extra:
.. code:: bash
pip install azure-kusto-data[aio]
The async client uses exact same interface as the regular client, except
that it lives in the ``azure.kusto.data.aio`` namespace, and it returns
``Futures`` you will need to ``await`` its
.. code:: python
from azure.kusto.data import KustoConnectionStringBuilder
from azure.kusto.data.aio import KustoClient
cluster = "<insert here your cluster name>"
client_id = "<insert here your AAD application id>"
client_secret = "<insert here your AAD application key>"
authority_id = "<insert here your AAD tenant id>"
async def sample():
kcsb = KustoConnectionStringBuilder.with_aad_application_key_authentication(cluster, client_id, client_secret, authority_id)
async with KustoClient(kcsb) as client:
db = "Samples"
query = "StormEvents | take 10"
response = await client.execute(db, query)
for row in response.primary_results[0]:
print(row[0], " ", row["EventType"])
Links
~~~~~
* `How to install the package <https://github.com/Azure/azure-kusto-python#install>`_.
* `Kusto query sample <https://github.com/Azure/azure-kusto-python/blob/master/azure-kusto-data/tests/sample.py>`_.
* `GitHub Repository <https://github.com/Azure/azure-kusto-python/tree/master/azure-kusto-data>`_.
5.0.5
Jul 20, 2025
5.0.4
Jun 24, 2025
5.0.3
May 04, 2025
5.0.2
Mar 30, 2025
5.0.1
Mar 12, 2025
5.0.0
Mar 11, 2025
4.6.3
Jan 09, 2025
4.6.2
Jan 07, 2025
4.6.1
Sep 30, 2024
4.6.0
Sep 29, 2024
4.5.1
Jun 19, 2024
4.5.0
Jun 18, 2024
4.4.1
May 06, 2024
4.4.0
Apr 09, 2024
4.3.1
Dec 18, 2023
4.3.0
Dec 12, 2023
4.2.0
May 18, 2023
4.1.4
Apr 16, 2023
4.1.3
Mar 26, 2023
4.1.2
Feb 22, 2023
4.1.1
Feb 12, 2023
4.1.0
Feb 09, 2023
4.0.2
Dec 15, 2022
4.0.1
Nov 30, 2022
4.0.0
Nov 23, 2022
3.1.3
Jun 08, 2022
3.1.2
Apr 14, 2022
3.1.1
Apr 04, 2022
3.1.0
Mar 07, 2022
3.0.1
Jan 20, 2022
3.0.0
Jan 16, 2022
2.3.2
Oct 07, 2021
2.3.1
Aug 01, 2021
2.3.0
Jul 18, 2021
2.2.1
Jul 15, 2021
2.2.0
Jul 01, 2021
2.1.3
Jun 10, 2021
2.1.2
Jun 01, 2021
2.1.1
Apr 04, 2021
2.1.0
Mar 17, 2021
2.0.0
Jan 07, 2021
1.0.3
Oct 11, 2020
1.0.2
Jul 29, 2020
1.0.1
Jul 23, 2020
1.0.0
Jul 12, 2020
0.1.0
May 31, 2020
0.0.45
May 06, 2020
0.0.44
Mar 03, 2020
0.0.43
Feb 04, 2020
0.0.42
Jan 28, 2020
0.0.41
Jan 28, 2020
0.0.40
Dec 29, 2019
0.0.39
Dec 02, 2019
0.0.38
Nov 02, 2019
0.0.37
Oct 28, 2019
0.0.36
Oct 03, 2019
0.0.35
Sep 22, 2019
0.0.33
Aug 27, 2019
0.0.32
Aug 25, 2019
0.0.31
Jun 12, 2019
0.0.30
May 16, 2019
0.0.29
Apr 21, 2019
0.0.28
Apr 18, 2019
0.0.27
Feb 25, 2019
0.0.26
Feb 21, 2019
0.0.25
Feb 14, 2019
0.0.24
Feb 12, 2019
0.0.23
Feb 10, 2019
0.0.22
Feb 06, 2019
0.0.21
Jan 24, 2019
0.0.20
Jan 03, 2019
0.0.19
Dec 11, 2018
0.0.18
Dec 05, 2018
0.0.17
Nov 25, 2018
0.0.16
Nov 19, 2018
0.0.15
Oct 16, 2018
0.0.14
Oct 11, 2018
0.0.13
Sep 25, 2018
0.0.12
Sep 15, 2018
0.0.11
Sep 04, 2018
0.0.10
Aug 20, 2018
0.0.9
Aug 12, 2018
0.0.8
Aug 12, 2018
0.0.7
Jul 17, 2018
0.0.6
Jul 16, 2018
0.0.5
Jun 27, 2018
0.0.4
Jun 06, 2018
0.0.3
May 17, 2018
0.0.2
Apr 15, 2018
0.0.1
Mar 15, 2018