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.3.tar.gz (38.3 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.3-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: adxpandas-0.2.3.tar.gz
  • Upload date:
  • Size: 38.3 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.3.tar.gz
Algorithm Hash digest
SHA256 a6b0fe20b8b4625f61d3878a65a346e80e9e3eb17d6f784b2e0ff3933541ddc4
MD5 bec29f79dbe04bdc4bc3447abefb079b
BLAKE2b-256 9f00208d9f806f30a2ca17c92f21ff607398e27cf1ef8010bf7d1ccebcabecfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for adxpandas-0.2.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: adxpandas-0.2.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 aa2ec259a025e6a37fb977da880a79b96da5547dd9d2b6ba6cfce1b9d09c63ef
MD5 d19353b7926184ecaa7c07281a7ebd21
BLAKE2b-256 795d35c1002c87770fe1ea7a2a1f6f6f48dbcf5a0cb418a4e54277dc29560ebc

See more details on using hashes here.

Provenance

The following attestation bundles were made for adxpandas-0.2.3-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