Skip to main content

Execute Kusto Query Language (KQL) queries over pandas DataFrames

Project description

adxpandas

PyPI Python

Execute Kusto Query Language (KQL) queries directly over one or more pandas DataFrames — no database required.

Installation

pip install adxpandas

For Jupyter notebook support (magic commands and chart rendering):

pip install adxpandas[notebook]

Quick Start

import pandas as pd
from adxpandas import AdxPandasClient

df = pd.DataFrame({
    "name": ["Ada", "Alan", "Grace"],
    "city": ["London", "London", "Arlington"],
    "score": [10, 20, 30],
})

client = AdxPandasClient({"Users": df})
result = client.query('Users | where city == "London" | project name, score')
print(result)

Wrap: Quick Single-DataFrame Queries

from adxpandas import Wrap

w = Wrap(df)
result = w.execute('self | where city == "London" | project name, score')
print(result.df)

# Method chaining
w.where('city == "London"').project("name", "score").take(5).df

Jupyter Magic

import adxpandas.magic  # registers %kql magic

# Line magic
%kql df | where city == "London" | take 5

# Cell magic
%%kql
df
| where score > 10
| summarize count() by city

Render Charts

w = Wrap(df)
w.execute('self | summarize avg(score) by city | render barchart')

Features

  • Pure pandas execution — no SQLite or other database dependencies
  • Full KQL parser with support for common operators
  • Operators: where, project, project-away, extend, summarize, sort, top, take, distinct, count, parse, join, union, render
  • Wrap class for quick single-DataFrame queries with method chaining
  • Jupyter %kql / %%kql magic for interactive notebooks
  • Chart rendering: timechart, barchart, columnchart, piechart, linechart
  • Scalar functions: string, math, datetime operations
  • Aggregate functions: count, sum, avg, min, max, dcount, countif, sumif, avgif
  • let statements (scalar and tabular)
  • Union source form queries

Documentation

See the full documentation for comprehensive guides covering both adxlite and adxpandas.

Acknowledgments

Some functionality in adxpandas was inspired by and references KustoPandas. We thank the KustoPandas authors for their pioneering work on KQL-over-pandas execution.

Links

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

adxpandas-0.2.2.tar.gz (37.9 kB view details)

Uploaded Source

Built Distribution

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

adxpandas-0.2.2-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file adxpandas-0.2.2.tar.gz.

File metadata

  • Download URL: adxpandas-0.2.2.tar.gz
  • Upload date:
  • Size: 37.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for adxpandas-0.2.2.tar.gz
Algorithm Hash digest
SHA256 faa547db1130598784d5afaa1a1d54a76f99d0808e05ad4f1fefc14f076a2b00
MD5 b5a4b293402658720399d84ad875bed9
BLAKE2b-256 06a3bfc1b29aa072d2d3ad01a83af36e96108844213a866ffbd26bfddbff71bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for adxpandas-0.2.2.tar.gz:

Publisher: publish.yml on richarddzh/adxlite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file adxpandas-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: adxpandas-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for adxpandas-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 272e44a42df259f85e209bc7fdb1971518bc73b329f18f116daac26698d87872
MD5 159dfd994cef5cabc77e44f3e88d47ed
BLAKE2b-256 4876ae512ee52a5ddc04a46ef05c5aef4ceafe59ffa676969edec269ed1c684a

See more details on using hashes here.

Provenance

The following attestation bundles were made for adxpandas-0.2.2-py3-none-any.whl:

Publisher: publish.yml on richarddzh/adxlite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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