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.1.tar.gz (27.0 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.1-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: adxpandas-0.2.1.tar.gz
  • Upload date:
  • Size: 27.0 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.1.tar.gz
Algorithm Hash digest
SHA256 a40329d912231024ef7916964ebfc21ec6f500eeea3238c9630400541eaedb76
MD5 8085853ee758f697faeccf06c5f15203
BLAKE2b-256 27ece1954ec5bb4111f9c168ee9662f3400cfdd9720190a59b85eb58200f0f9e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: adxpandas-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 28.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4c23ce393931912fe1aad7e087a7a56d59e203c55d54f75b18faaba40f0217c5
MD5 05ffb0a517c92ef886662793e2226762
BLAKE2b-256 71b5d28af1c5ffb014d6d63abbac5d65636f7735fff6500f347157bb6849b14f

See more details on using hashes here.

Provenance

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