CLI for AirMettle's Airstat service on Azure
Project description
AirStat CLI
Command-line tool for AirMettle's AirStat service on Azure. Generate AirTree histograms and run queries against data stored in your own Azure Blob Storage.
Installation
pip install airstat
Quick Start
- Authenticate once with your Microsoft account (organizational or personal).
- Create two small JSON configuration files.
- Run the generate command.
1. Authenticate
airstat auth login
This starts a device-code flow. Follow the instructions in your terminal (you'll be asked to open a browser and enter a short code). Your token is cached locally so you only need to do this occasionally.
Other useful auth commands:
airstat auth status # Show who you're logged in as
airstat auth logout # Clear cached credentials
2. Create Configuration Files
You need two files:
profile.json – Your storage account and target service
{
"bucket_props": {
"account_name": "yourstorageaccount",
"account_key": "YOUR_STORAGE_ACCOUNT_KEY",
"container": "your-container",
"object": "your-input-file.bin"
}
}
• bucket_props: Location of your input data in Azure Blob Storage. • airstat_url (optional): The CLI talks to AirMettle's AirStat service by default. Set this only to target a different AirStat deployment.
airstat.json – The AirTree request you want to run
{
"airtree": {
"config": "1DxT",
"schema": {
"id": "binary",
"dtype": "double"
}
}
}
See the samples/ directory in the source repository for more complete examples (including 2D/3D/4D configs).
3. Run a Generate Operation
airstat generate -p profile.json -a airstat.json
The CLI will:
- Use your cached Microsoft token
- Send the request to the configured Airstat service (protected by Azure Easy Auth)
- Return the result
How Authentication Works
The CLI uses Microsoft Authentication Library (MSAL) with the device code flow. You authenticate interactively once. The resulting access token is sent as a Bearer token to the Airstat service.
No secrets are required on your machine beyond the one-time interactive login.
Configuration Files
| File | Purpose | Required for |
|---|---|---|
| profile.json | Storage account + optional Airstat URL | All commands |
| airstat.json | The actual AirTree request (config + schema) | generate, query |
Examples
The samples/ folder contains ready-to-use airstat.json request bodies. Each file holds only the airtree payload — pair it with your own profile.json (storage account, plus optional service URL override) via -p and -a.
Generate (/api/v1/generate)
| Sample file | Config | Input schema | Notes |
|---|---|---|---|
airstat.json |
1DxT | binary (double) |
Minimal 1D example |
1DxT_generate.json |
1DxT | binary (double) |
13-bit, most compact |
1DxF_generate.json |
1DxF | binary (double) |
16-bit, fastest |
1DxP_generate.json |
1DxP | binary (double) |
20-bit, highest precision |
2DxP_generate.json |
2DxP | Parquet (PAR1) |
2 columns |
2DxF_generate.json |
2DxF | Parquet (PAR1) |
2 columns |
3DxP_generate.json |
3DxP | Parquet (PAR1) |
3 columns |
3DxF_generate.json |
3DxF | Parquet (PAR1) |
3 columns |
4DxP_generate.json |
4DxP | Parquet (PAR1) |
4 columns |
4DxF_generate.json |
4DxF | Parquet (PAR1) |
4 columns |
4DxPc_generate.json |
4DxPc | Parquet (PAR1) |
4 columns |
1D configs require a raw binary blob; set bucket_props.object in profile.json to your .bin file. Supported binary dtypes: double, float, int32, int64.
2D–4D configs require a Parquet file; set dimInfo.colName to match your column names.
airstat generate -p profile.json -a samples/1DxT_generate.json
airstat generate -p profile.json -a samples/2DxP_generate.json
Query (/api/v1/query)
Query samples target an existing histogram in blob storage (the output of a prior generate). Point bucket_props.object in profile.json at that .airtree file.
| Sample file | Query type | Typical histogram |
|---|---|---|
minvalue_query.json |
minvalue |
1D |
maxvalue_query.json |
maxvalue |
1D |
mincount_query.json |
mincount |
1D |
maxcount_query.json |
maxcount |
1D |
topk_query.json |
topk |
1D |
percentile_query.json |
percentile |
1D |
cdf_query.json |
cdf |
1D |
box_query.json |
box |
2D |
grid_query.json |
grid |
2D |
airstat query -p profile.json -a samples/minvalue_query.json
airstat query -p profile.json -a samples/grid_query.json
Notes
- The package is built with the required Entra client ID pre-bundled. You do not need to set any environment variables.
- All network calls to the Airstat service are authenticated with your Microsoft identity.
License
MIT — see the LICENSE file. Use of the AirStat services themselves is governed by your service agreement (e.g., via the Microsoft commercial marketplace).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file airstat-1.0.0.tar.gz.
File metadata
- Download URL: airstat-1.0.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22c4f4b3c203924d6f13d4c73608dcaa073686cb931a5f67f2e1a23c5bce6662
|
|
| MD5 |
255fbeb2461a8bb56c049bc745c7d709
|
|
| BLAKE2b-256 |
30bb94409eec86aab30989175c6f6361d47e05dcf528e6eef5266b2b6bc56c5b
|
File details
Details for the file airstat-1.0.0-py3-none-any.whl.
File metadata
- Download URL: airstat-1.0.0-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee59d0cbcfb857903241b028be53c66217023e6e92a47ea4f7e49f57b01a4b6f
|
|
| MD5 |
82b9a80a83998d5be01a8c322639269d
|
|
| BLAKE2b-256 |
c1330813ae72241a059d4e2c7c027eb41aaf1f7177b47c671bb2e7956a557320
|