azure-kusto-data


Nameazure-kusto-data JSON
Version 4.4.0 PyPI version JSON
download
home_pagehttps://github.com/Azure/azure-kusto-python
SummaryKusto Data Client
upload_time2024-04-09 05:14:53
maintainerNone
docs_urlNone
authorMicrosoft Corporation
requires_pythonNone
licenseMIT
keywords kusto wrapper client library
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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>`_.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Azure/azure-kusto-python",
    "name": "azure-kusto-data",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "kusto wrapper client library",
    "author": "Microsoft Corporation",
    "author_email": "kustalk@microsoft.com",
    "download_url": "https://files.pythonhosted.org/packages/2d/fe/b08ef1d862b786da8fc58eb68b3fca8aa51243b6f0436fbb1da0cca53b78/azure-kusto-data-4.4.0.tar.gz",
    "platform": null,
    "description": "Microsoft Azure Kusto Library for Python\n========================================\n\nOverview\n--------\n\n.. code-block:: python\n\n    from azure.kusto.data import KustoClient, KustoConnectionStringBuilder\n\n    cluster = \"<insert here your cluster name>\"\n    client_id = \"<insert here your AAD application id>\"\n    client_secret = \"<insert here your AAD application key>\"\n    authority_id = \"<insert here your AAD tenant id>\"\n\n    kcsb = KustoConnectionStringBuilder.with_aad_application_key_authentication(cluster, client_id, client_secret, authority_id)\n    # It is a good practice to re-use the KustoClient instance, as it maintains a pool of connections to the Kusto service.\n    # This sample shows how to create a client and close it in the same scope, for demonstration purposes.\n    with KustoClient(kcsb) as client:\n        db = \"Samples\"\n        query = \"StormEvents | take 10\"\n\n        response = client.execute(db, query)\n        for row in response.primary_results[0]:\n            print(row[0], \" \", row[\"EventType\"])\n\n\n\n*Kusto Python Client* Library provides the capability to query Kusto clusters using Python.\nIt is Python 3.x compatible and supports\nall data types through familiar Python DB API interface.\n\nIt's possible to use the library, for instance, from `Jupyter Notebooks\n<http://jupyter.org/>`_.\nwhich are attached to Spark clusters,\nincluding, but not exclusively, `Azure Databricks\n<https://azure.microsoft.com/en-us/services/databricks/>`_. instances.\n\nAsync Client\n~~~~~~~~~~~~\nKusto now provides an asynchronous client for queries.\n\nTo use the client, first install the package with the \"aio\" extra:\n\n.. code:: bash\n\n    pip install azure-kusto-data[aio]\n\nThe async client uses exact same interface as the regular client, except\nthat it lives in the ``azure.kusto.data.aio`` namespace, and it returns\n``Futures`` you will need to ``await`` its\n\n.. code:: python\n\n    from azure.kusto.data import KustoConnectionStringBuilder\n    from azure.kusto.data.aio import KustoClient\n\n    cluster = \"<insert here your cluster name>\"\n    client_id = \"<insert here your AAD application id>\"\n    client_secret = \"<insert here your AAD application key>\"\n    authority_id = \"<insert here your AAD tenant id>\"\n\n\n    async def sample():\n        kcsb = KustoConnectionStringBuilder.with_aad_application_key_authentication(cluster, client_id, client_secret, authority_id)\n        async with KustoClient(kcsb) as client:\n            db = \"Samples\"\n            query = \"StormEvents | take 10\"\n\n            response = await client.execute(db, query)\n            for row in response.primary_results[0]:\n                print(row[0], \" \", row[\"EventType\"])\n\nLinks\n~~~~~\n\n* `How to install the package <https://github.com/Azure/azure-kusto-python#install>`_.\n\n* `Kusto query sample <https://github.com/Azure/azure-kusto-python/blob/master/azure-kusto-data/tests/sample.py>`_.\n\n* `GitHub Repository <https://github.com/Azure/azure-kusto-python/tree/master/azure-kusto-data>`_.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Kusto Data Client",
    "version": "4.4.0",
    "project_urls": {
        "Homepage": "https://github.com/Azure/azure-kusto-python"
    },
    "split_keywords": [
        "kusto",
        "wrapper",
        "client",
        "library"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f2c566053e2190ce6e21068fcd54e5b1879ad23efe8a55b40ca00b552c8030d",
                "md5": "565a60b73fb04dc26f1e2814d6f95d22",
                "sha256": "1e3787744a139fd62ad415b16b490617a7665f3ba74d87eaada4e0cec53b2518"
            },
            "downloads": -1,
            "filename": "azure_kusto_data-4.4.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "565a60b73fb04dc26f1e2814d6f95d22",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 50416,
            "upload_time": "2024-04-09T05:14:51",
            "upload_time_iso_8601": "2024-04-09T05:14:51.440714Z",
            "url": "https://files.pythonhosted.org/packages/5f/2c/566053e2190ce6e21068fcd54e5b1879ad23efe8a55b40ca00b552c8030d/azure_kusto_data-4.4.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2dfeb08ef1d862b786da8fc58eb68b3fca8aa51243b6f0436fbb1da0cca53b78",
                "md5": "5500b01a16493ec7513d8cbfda50de6f",
                "sha256": "1fe0ff0594d40bd95d6eef6addddf9752d0f3a1563bb7b12ab5ceaa249cad476"
            },
            "downloads": -1,
            "filename": "azure-kusto-data-4.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5500b01a16493ec7513d8cbfda50de6f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 40473,
            "upload_time": "2024-04-09T05:14:53",
            "upload_time_iso_8601": "2024-04-09T05:14:53.723419Z",
            "url": "https://files.pythonhosted.org/packages/2d/fe/b08ef1d862b786da8fc58eb68b3fca8aa51243b6f0436fbb1da0cca53b78/azure-kusto-data-4.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-09 05:14:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Azure",
    "github_project": "azure-kusto-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "azure-kusto-data"
}
        
Elapsed time: 0.30993s