duckdb-and-polars-fast-data

duckdb-and-polars-fast-data is a skill for Claude Code, Codex from hamzabellouch/agent-skills. It costs 41 tokens per session (1,575 once invoked), scanned A, original, MIT.

A guide to using DuckDB, an in-process SQL database, and Polars, a fast table-processing library, for local data analysis with Apache Arrow and Parquet.

In plain words
What is it for?
Use it for SQL analysis, Python data pipelines, micro-ETL jobs, and reading or writing columnar data files.
Why use it?
It helps process large tables efficiently without requiring a separate database server, including data that may not fit entirely in memory.

Skill for Claude CodeCodex

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

Good fit Use it for SQL analysis, Python data pipelines, micro-ETL jobs, and reading or writing columnar data files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hamzabellouch/agent-skills/duckdb-and-polars-fast-data
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 hamzabellouch/agent-skills --skill duckdb-and-polars-fast-data
Clone the repo
git clone --depth 1 https://github.com/hamzabellouch/agent-skills

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 duckdb-and-polars-fast-data

README.md
[![agentmods](https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/duckdb-and-polars-fast-data/github.svg)](https://agentmods.dev/skills/hamzabellouch/agent-skills/duckdb-and-polars-fast-data)
Your own site
<a href="https://agentmods.dev/skills/hamzabellouch/agent-skills/duckdb-and-polars-fast-data"><img src="https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/duckdb-and-polars-fast-data/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 duckdb-and-polars-fast-data

Your own site · 80×15
<a href="https://agentmods.dev/skills/hamzabellouch/agent-skills/duckdb-and-polars-fast-data"><img src="https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/duckdb-and-polars-fast-data.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,575 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00041 $0.01575
Opus 5 $0.00020 $0.00788
Sonnet 5 $0.00008 $0.00315
Haiku 4.5 $0.00004 $0.00158

Measured 8d ago against content hash 2820d8b30f1c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

duckdb-and-polars-fast-data scanned grade A with 0 findings 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 8d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Data Engineering and Pipelines/duckdb-and-polars-fast-data/SKILL.md · 174 lines

How it starts

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

DuckDB & Polars: Fast Local & In-Process Data Engineering

Production guide for architecting ultra-fast, single-node data processing engines using DuckDB and Polars. Ideal for sub-second analytics, serverless micro-ETL pipelines, and memory-efficient out-of-core computations.


1. Architectural Foundation & Comparison

Feature DuckDB Polars
Engine Architecture In-process vectorized C++ SQL OLAP Database Multi-threaded Rust DataFrame Engine
Primary Interface SQL, Python DB-API, Relational API Expression API, LazyFrame / DataFrame
Execution Model Vectorized Query Execution (Morsel Driven) Query Engine with Expression Fusion & Pushdowns
Out-Of-Core Execution Native automatic disk spilling for larger-than-RAM Native sink_parquet() / streaming engine
Data Interop Zero-copy Apache Arrow, Parquet, Iceberg Zero-copy PyArrow, Arrow C Data Interface

2. Zero-Copy Interoperability & Memory Pipeline

┌─────────────────────────┐     Apache Arrow Interop      ┌─────────────────────────┐
│ DuckDB (SQL Engine)     │ ◄───────────────────────────► │ Polars (Lazy Engine)    │
│ Direct Parquet Scan     │         (Zero Copy)           │ Expressions & Streaming │
└─────────────────────────┘                               └─────────────────────────┘

By leveraging Apache Arrow as a unified in-memory representation, datasets can be passed between DuckDB and Polars with zero memory duplication overhead.


3. Idempotent Write Patterns & Partitioning

3.1 DuckDB Atomic Partition Overwrite

import duckdb

conn = duckdb.connect("analytics.duckdb")

# Atomic replacement of table partition within transaction block
conn.execute("""
BEGIN TRANSACTION;

DELETE FROM sales_fact WHERE sale_date = '2026-07-18';

INSERT INTO sales_fact 
SELECT * FROM read_parquet('s3://ingest/2026-07-18/*.parquet');

COMMIT;
""")

3.2 Polars Atomic Out-of-Core Partition Sink

import polars as pl

# Write LazyFrame stream to Parquet atomically
lazy_df = pl.scan_parquet("s3://raw-events/*.parquet") \
    .filter(pl.col("event_date") == "2026-07-18") \
    .with_columns([
        (pl.col("raw_amount") * pl.col("fx_rate")).alias("amount_usd")
    ])

# Sink directly to disk with chunked memory allocation
lazy_df.sink_parquet(
    "s3://silver-events/event_date=2026-07-18/data.parquet",
    compression="snappy",
    statistics=True
)

Read the full file on GitHub · 174 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. 8d ago First seen · 174 lines · 41 tokens per session scan A 2820d8b30f1c

Subscribe to this mod's changes

duckdb-and-polars-fast-data is a skill published in the GitHub repository hamzabellouch/agent-skills (4 stars, last pushed 1mo ago), licensed MIT. It adds 41 tokens to every session and 1,575 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

spec-implement

Orchestrate parallel implementation of a feature specification by dispatching coder agents batch-by-batch with code review gates between batches. Use this skill when the user says "implement this feature", "start implementing", "run the spec", "execute the plan", "continue implementing", or wants to begin coding a…

benjaminthomas/spec-driven-dev · 130 tokens

spec-create

Create a structured feature specification with self-contained task files organized into parallel execution batches. Use this skill when the user says "create a spec", "plan this feature", "write up an implementation plan", "break this into tasks", or after any planning conversation where the user wants to capture…

benjaminthomas/spec-driven-dev · 118 tokens

spec-ship

Push the current branch to GitHub and create a pull request. Use this skill when the user says "ship it", "ship this", "push to github", "create a pr", "open a pull request", "send for review", "get this reviewed", or wants to push their work and open a PR. Also use when the user says "/spec-ship" (or their host's…

benjaminthomas/spec-driven-dev · 119 tokens

spec-checkpoint

Create a comprehensive checkpoint commit with detailed analysis of all changes. Use this skill when the user says "checkpoint", "commit everything", "save my progress", "create a commit", or wants to stage and commit all current changes with a well-crafted message. Also use when the user says "/spec-checkpoint" (or…

benjaminthomas/spec-driven-dev · 98 tokens

generative-seo

Run an evidence-based SEO + GEO (Generative Engine Optimization) program for ANY website or product codebase — auditing technical SEO, writing or retrofitting content so it gets cited by ChatGPT/Perplexity/AI Overviews, tracking AI-citation visibility, refreshing competitor research, and drafting distribution posts.…

benjaminthomas/spec-driven-dev · 180 tokens

spec-verify

Verify a completed feature spec by driving the real running app — not just lint/typecheck/build — and checking off every acceptance criterion from its specs/{feature}/ folder one by one. Use this after /spec-implement finishes a spec, when the user says "test this end to end", "verify this feature actually works"…

benjaminthomas/spec-driven-dev · 210 tokens