Decimal CSV/ETL & Quarantine Pipeline

    by Víctor Betancourt

    1

    Stop float rounding drift, silent row drops, and duplicate cron imports in Python CSV pipelines.

    $12

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Decimal CSV/ETL & Quarantine Pipeline

    Example session with this skill installed

    Audit my etl_script.py for financial data traps and then generate a command to ingest orders.csv using EU locale and DMY dates into a local ledger.sqlite3 database.

    • Read your context and instructions
    • Compiled the decimal csv etl
    • Generated the data export

    I have completed the static audit of etl_script.py and prepared the ingestion command for your European order data.

    The audit identified two critical risks: the use of float for currency columns which will cause rounding drift, and a missing busy_timeout on the SQLite connection which may lead to locking failures during concurrent writes.

    ETL Audit and Ingestion Plan

    Audit Results for etl_script.py

    IDSeverityFindingRecommendation
    ETL-001HIGHFloat coercion detected on line 42Use decimal.Decimal with explicit quantization
    ETL-003MEDIUMMissing utf-8-sig handlingUse encoding="utf-8-sig" to handle Excel BOMs
    ETL-004AMEDIUMNo SQLite busy_timeoutSet PRAGMA busy_timeout=5000 for WAL safety

    Ingestion Command

    
    # Ingesting with EU locale (1.234,56) and DMY dates (31/12/2023)
    python3 scripts/quarantine_etl.py \
      --input orders.csv \
      --schema assets/sample_schema.json \
      --out-dir ./out \
      --db ./out/ledger.sqlite3 \
      --locale eu \
      --date-order dmy \
      --delimiter ";" \
      --json
    

    Next steps

    1. Refactor etl_script.py to replace float() calls with decimal.Decimal.
    2. Run the ingestion command and check ./out/quarantine.csv for any rows that failed the locale validation.
    3. Verify the ledger.sqlite3 contents to ensure the SHA-256 fingerprints correctly prevented duplicate entries.

    quarantine.csv

    CSV · data export

    Generated

    Example file from a real run - the skill writes it into your workspace.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Stop losing financial data to silent rounding errors and failed batch imports. This skill provides a specialized pipeline for ingesting messy CSV data into SQLite with absolute precision and crash-safety. It replaces fragile float math with strict decimal.Decimal logic and ensures every row is either safely committed or formally quarantined.

    What it does

    • Strict Decimal Parsing converts currency and quantity strings directly into decimal.Decimal to eliminate binary floating-point drift in accounting.
    • Row-Level Quarantine routes malformed or ambiguous rows to a structured quarantine.csv with line numbers and error codes instead of aborting the job.
    • Idempotency Guarding uses SHA-256 content fingerprints and SQLite WAL mode to prevent duplicate imports from retried crons or webhooks.
    • Locale Normalization handles mixed US/EU decimal separators and ambiguous date formats through explicit configuration rather than guessing.
    • Static Code Auditing scans existing Python ETL scripts for common traps like missing BOM handling, broad exceptions, or unsafe SQLite locking.

    How it works

    1. Audit existing code using the AST scanner to identify ETL-001 (float money) or ETL-004 (unsafe SQLite locks) defects.
    2. Configure the ingestion schema and locale settings to match the source data's decimal and date conventions.
    3. Execute the quarantine pipeline to process CSV inputs, populating the SQLite ledger and generating a quarantine report for invalid rows.
    4. Verify idempotency by re-running the same input to confirm zero new insertions and zero data corruption.

    Frameworks & tools

    Python 3.10+ standard library. Uses decimal, sqlite3 in WAL mode, hashlib, and ast for static analysis. Zero external dependencies or network access required.

    Why this beats prompting it yourself

    Prompting an LLM for ETL logic often results in code that uses pandas defaults or simple float() casts, leading to 0.01 rounding errors. This skill enforces specific SQLite BEGIN IMMEDIATE patterns and utf-8-sig handling that are frequently overlooked in generic AI-generated code.

    Use cases

    • Ingesting financial CSVs with mixed separators without rounding drift.
    • Deduplicating recurring batch imports using collision-free fingerprints.
    • Handling malformed rows in high-volume pipelines without dropping data.
    • Auditing legacy Python scripts for monetary and crash-safety bugs.

    Known limitations

    Requires Python 3.10 or higher. Designed for CSV and SQLite workflows only. Does not support non-relational destinations or Excel (.xlsx) files directly without conversion to CSV.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 8 days ago

    Software
    Python 3.10+

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed8 days ago

    What's inside

    Frequently Asked Questions

    This skill solves the 'silent rounding error' problem by replacing standard floating-point math with strict decimal precision, and it prevents job crashes by routing malformed data to a quarantine file rather than aborting the entire import.

    The skill is built for Python 3.10+ and is compatible with any AI agent capable of executing Python code. It has zero external dependencies, making it highly portable across local environments and sandboxed AI runners.

    Each purchase includes the core ETL pipeline logic, the AST-based static code auditor for identifying existing bugs, and a configuration template for handling various international decimal and date formats.

    No, this skill is purpose-built for high-integrity CSV-to-SQLite workflows. To process Excel (.xlsx) files, you must first convert them to CSV format to ensure the strict decimal parsing works correctly.

    The skill uses SHA-256 content fingerprinting to create a unique signature for every batch. If you attempt to import the same data twice, the 'Idempotency Guard' recognizes the fingerprint and prevents duplicate entries or database corruption.

    Setup is minimal; once the skill is added to your agent's library, you simply define your source CSV path and SQLite destination. The included auditor can then be run immediately against your existing scripts to suggest safety improvements.

    New in Data & Databases

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.