python-csv-generation

python-csv-generation is a skill for Claude Code, Codex from cxcscmu/SkillLearnBench. It costs 22 tokens per session (873 once invoked), scanned A, original, MIT.

A Python guide for writing structured CSV files. CSV is a simple text format for rows and columns that many spreadsheet and data tools can open.

In plain words
What is it for?
Export records with headers and rows using Python's built-in csv module.
Why use it?
It turns Python data into a portable table without requiring an extra spreadsheet library.

Skill for Claude CodeCodex

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

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.

agentmods
npx agentmods add skills/cxcscmu/skilllearnbench/python-csv-generation
Any agent
npx skills add cxcscmu/SkillLearnBench --skill python-csv-generation
Clone the repo
git clone --depth 1 https://github.com/cxcscmu/SkillLearnBench

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 python-csv-generation

README.md
[![agentmods](https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/python-csv-generation.svg)](https://agentmods.dev/skills/cxcscmu/skilllearnbench/python-csv-generation)
Your own site
<a href="https://agentmods.dev/skills/cxcscmu/skilllearnbench/python-csv-generation"><img src="https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/python-csv-generation.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 873 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00022 $0.00873
Opus 5 $0.00011 $0.00436
Sonnet 5 $0.00004 $0.00175
Haiku 4.5 $0.00002 $0.00087

Measured 2d ago against content hash bd5bcadf1160, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

python-csv-generation 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 2d 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.

skills/b1-one-shot-claude-haiku-4-5/video-object-counting/python-csv-generation/SKILL.md · 122 lines

How it starts

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

Python CSV Generation

Overview

The Python csv module provides functionality to read and write CSV (Comma-Separated Values) files. CSV is a standard format for tabular data that's widely compatible with spreadsheet applications.

Installation

Built-in to Python, no installation needed.

Basic Usage

Writing CSV with DictWriter (Recommended)

import csv

# Data to write
data = [
    {'frame_id': '/root/keyframes_001.png', 'coins': 5, 'enemies': 2, 'turtles': 1},
    {'frame_id': '/root/keyframes_002.png', 'coins': 3, 'enemies': 1, 'turtles': 0},
    {'frame_id': '/root/keyframes_003.png', 'coins': 7, 'enemies': 3, 'turtles': 2},
]

# Write to CSV file
with open('output.csv', 'w', newline='') as csvfile:
    fieldnames = ['frame_id', 'coins', 'enemies', 'turtles']
    writer = csv.DictWriter(csvfile, fieldnames=fieldnames)

    # Write header row
    writer.writeheader()

    # Write data rows
    writer.writerows(data)

Writing CSV with writer (Simple approach)

import csv

with open('output.csv', 'w', newline='') as csvfile:
    writer = csv.writer(csvfile)

    # Write header
    writer.writerow(['frame_id', 'coins', 'enemies', 'turtles'])

    # Write data rows
    writer.writerow(['/root/keyframes_001.png', 5, 2, 1])
    writer.writerow(['/root/keyframes_002.png', 3, 1, 0])

Complete Example: Frame Analysis Results

import csv
import os
from pathlib import Path

def write_counting_results(results, output_path):
    """
    Write object counting results to CSV.

    Args:
        results: List of dicts with keys:
                 'frame_id', 'coins', 'enemies', 'turtles'
        output_path: Path to output CSV file
    """
    fieldnames = ['frame_id', 'coins', 'enemies', 'turtles']

    with open(output_path, 'w', newline='') as csvfile:
        writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
        writer.writeheader()
        writer.writerows(results)

    print(f"Results written to {output_path}")

# Example usage
results = [
    {
        'frame_id': '/root/keyframes_001.png',
        'coins': 5,
        'enemies': 2,
        'turtles': 1
    },
    {
        'frame_id': '/root/keyframes_002.png',
        'coins': 3,
        'enemies': 1,
        'turtles': 0
    }
]

write_counting_results(results, '/root/counting_results.csv')

Read the full file on GitHub · 122 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. 2d ago First seen · 122 lines · 22 tokens per session scan A bd5bcadf1160

Subscribe to this mod's changes

python-csv-generation is a skill published in the GitHub repository cxcscmu/SkillLearnBench (83 stars, last pushed 1mo ago), licensed MIT. It adds 22 tokens to every session and 873 once invoked, about $0.0001 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

rdkit

Cheminformatics toolkit for fine-grained molecular control. SMILES/SDF parsing, descriptors (MW, LogP, TPSA), fingerprints, substructure search, 2D/3D generation, similarity, reactions. For standard workflows with simpler interface, use datamol (wrapper around RDKit). Use rdkit for advanced control, custom…

benchflow-ai/skillsbench · 80 tokens

pcap-analysis

Guidance for analyzing network packet captures (PCAP files) and computing network statistics using Python, with tested utility functions.

benchflow-ai/skillsbench · 28 tokens

memory-optimization

Optimize Python code for reduced memory usage and improved memory efficiency. Use when asked to reduce memory footprint, fix memory leaks, optimize data structures for memory, handle large datasets efficiently, or diagnose memory issues. Covers object sizing, generator patterns, efficient data structures, and memory…

benchflow-ai/skillsbench · 60 tokens

python-parallelization

Transform sequential Python code into parallel/concurrent implementations. Use when asked to parallelize Python code, improve code performance through concurrency, convert loops to parallel execution, or identify parallelization opportunities. Handles CPU-bound (multiprocessing), I/O-bound (asyncio, threading), and…

benchflow-ai/skillsbench · 68 tokens

trl

Reference for the TRL (Transformer Reinforcement Learning) library codebase. Use proactively before reading or editing any file under trl/ so you have the intended contracts and invariants in mind, not just what the current code says. Covers trainer hierarchy (SFT, DPO, GRPO, KTO), shared utility functions…

benchflow-ai/skillsbench · 100 tokens

parallel-processing

Parallel processing with joblib for grid search and batch computations. Use when speeding up computationally intensive tasks across multiple CPU cores.

benchflow-ai/skillsbench · 28 tokens