powerbi-spark-livy

powerbi-spark-livy is a skill for Claude Code, Codex from santoshkanthety/powerbi-agent. It costs 119 tokens per session (1,713 once invoked), scanned A, original, MIT.

A guide to running PySpark or Python on Microsoft Fabric Spark compute through the Livy API, without creating a notebook. Livy provides temporary sessions for code that reads or writes lakehouse Delta tables.

In plain words
What is it for?
Use it to profile Delta tables, check row counts, test transformations, submit batch work, and read or write lakehouse data through temporary Spark sessions.
Why use it?
It supports one-off data checks and transformations without leaving a notebook artifact behind. The guide also covers session cleanup so temporary work does not keep consuming shared computing capacity.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to profile Delta tables, check row counts, test transformations, submit batch work, and read or write lakehouse data through temporary Spark sessions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/santoshkanthety/powerbi-agent/powerbi-spark-livy
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add santoshkanthety/powerbi-agent --skill powerbi-spark-livy
Clone the repo
git clone --depth 1 https://github.com/santoshkanthety/powerbi-agent

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for powerbi-spark-livy

README.md
[![agentmods](https://agentmods.dev/badge/skills/santoshkanthety/powerbi-agent/powerbi-spark-livy/github.svg)](https://agentmods.dev/skills/santoshkanthety/powerbi-agent/powerbi-spark-livy)
Your own site
<a href="https://agentmods.dev/skills/santoshkanthety/powerbi-agent/powerbi-spark-livy"><img src="https://agentmods.dev/badge/skills/santoshkanthety/powerbi-agent/powerbi-spark-livy/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for powerbi-spark-livy

Your own site · 80×15
<a href="https://agentmods.dev/skills/santoshkanthety/powerbi-agent/powerbi-spark-livy"><img src="https://agentmods.dev/badge/skills/santoshkanthety/powerbi-agent/powerbi-spark-livy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 119 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,713 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00119 $0.01713
Opus 5.5 $0.00048 $0.00685
Sonnet 5.5 $0.00024 $0.00343
Haiku 4.5 $0.00012 $0.00171

Measured 16d ago against content hash 7963863aaa51, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

powerbi-spark-livy scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

result = subprocess.run(
skills/powerbi-spark-livy/SKILL.md · 156 lines

How it starts

The opening of the file, as written. The whole thing — 156 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Executing Spark on Fabric without a notebook

The Livy endpoint on a Fabric lakehouse runs arbitrary PySpark or Python on Fabric Spark compute as an ephemeral session — no notebook artifact is created, nothing is persisted in the workspace, and the session is yours to delete. It is the right tool for profiling a Delta table, checking a silver-layer row count, validating a transform before it becomes a pipeline, or answering "is the data even there" without leaving a notebook behind in a governed workspace.

It is the wrong tool for anything scheduled or reviewed. If the code should run again tomorrow, it belongs in a notebook or a Spark job definition under source control — powerbi-fabric-pipelines.

Prerequisites

Requirement Check
Azure CLI signed in az account show
A lakehouse in the target workspace the session runs against it; fab ls "<ws>.Workspace"
Fabric capacity (F SKU or trial) Spark draws CU — see below
Workspace Contributor or above session creation is a write operation

Authentication — the one thing people get wrong

The Livy API needs a token scoped to the Fabric service, acquired through Azure CLI:

import json
import subprocess

result = subprocess.run(
    ["az", "account", "get-access-token", "--resource", "https://api.fabric.microsoft.com"],
    capture_output=True,
    text=True,
    check=True,
)
token = json.loads(result.stdout)["accessToken"]

Two rules:

  • A fab auth token is not interchangeable here. It will authenticate the call and then fail on OneLake storage access from inside the Spark session, which surfaces as a confusing permission error on the first spark.read, not on session creation.
  • Never print, log or echo the token, and never pass it on a command line — process arguments are readable by other users on the host. Pass it in the Authorization header from in-process variables only.

Session lifecycle

1. POST   .../livyapi/versions/<ver>/sessions                 {"kind": "pyspark"}
2. GET    .../sessions/{id}                 poll until state == "idle"   (~30–90 s cold)
3. POST   .../sessions/{id}/statements      {"code": "...", "kind": "pyspark"}
4. GET    .../sessions/{id}/statements/{n}  poll until state == "available"
5. DELETE .../sessions/{id}                 ALWAYS — in a finally block

Read the full file on GitHub · 156 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 16d ago First seen · 156 lines · 0 tokens per session scan A 7963863aaa51

Subscribe to this mod's changes

powerbi-spark-livy is a skill published in the GitHub repository santoshkanthety/powerbi-agent (3 stars, last pushed 17d ago), licensed MIT. It adds 119 tokens to every session and 1,713 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-07.

Related

Other skills, from other repositories

umap-learn

Applies UMAP-learn to nonlinear dimensionality reduction, 2D/3D embeddings, clustering preprocessing, supervised or semi-supervised UMAP, DensMAP, AlignedUMAP, and Parametric UMAP workflows.

K-Dense-AI/scientific-agent-skills · 52 tokens

optimize-for-gpu

GPU-accelerates scientific Python on NVIDIA hardware and verifies that the result is correct and faster. Use for CUDA/GPU optimization; CPU-bound NumPy, SciPy, pandas, scikit-learn, NetworkX, scikit-image, vector-search, image-processing, graph, simulation, or file-I/O workloads; CuPy, cuDF, cuML, cuGraph, cuVS…

K-Dense-AI/scientific-agent-skills · 151 tokens

shap

Explain and audit machine-learning predictions with SHAP. Use for selecting SHAP explainers and maskers, computing and validating feature attributions, handling multi-output explanations, and producing local or global SHAP visualizations.

K-Dense-AI/scientific-agent-skills · 46 tokens

torchdrug

Builds and troubleshoots TorchDrug 0.2.1 workflows for molecular graphs, property prediction, self-supervised pretraining, molecule generation, retrosynthesis, protein representation learning, and knowledge graph reasoning. Use when code imports torchdrug or needs its datasets, models, tasks, or Engine.

K-Dense-AI/scientific-agent-skills · 64 tokens

transformers

Hugging Face Transformers for loading Hub models, running pipeline inference, text generation, and Trainer fine-tuning on NLP, vision, audio, and multimodal tasks. Applies when working with AutoModel, pipelines, tokenizers, generation configs, or TrainingArguments within Transformers.

K-Dense-AI/scientific-agent-skills · 58 tokens

deepspot-m

Generates transcriptome-wide virtual spatial transcriptomics from H&E histology with DeepSpot-M. Used for predicted log1p-CPM expression from 224x224 tiles at about 20x, querying the released protein-coding gene panel by symbol, and whole-slide prediction after resolution-aware tiling with histolab.

K-Dense-AI/scientific-agent-skills · 70 tokens