csv cleaner skill

    1

    A Python utility to strip whitespace from CSV record values while preserving data types and structure.

    Free

    2 installsSecurity scanned

    Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+22 more

    csv cleaner skill

    Example session with this skill installed

    I have a list of records from a messy CSV export with extra spaces in the names and categories. Can you show me how to clean them using the record_ops utility?

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

    I have processed the records using the clean_record utility. This ensures all string values are trimmed while preserving numerical types for downstream analysis.

    Cleaned Data Output

    Original KeyRaw ValueCleaned ValueType
    user_id101101int
    username" jdoe88 ""jdoe88"str
    email" tech@example.com ""tech@example.com"str
    account_bal1500.501500.50float
    status" active ""active"str
    from record_ops import clean_record
    
    # Example of batch processing the dataset
    raw_records = [
        {"user_id": 101, "username": "  jdoe88  ", "email": " tech@example.com ", "account_bal": 1500.50, "status": " active "},
        {"user_id": 102, "username": " admin ", "email": "admin@ops.net  ", "account_bal": 0.00, "status": "inactive"}
    ]
    
    cleaned_records = [clean_record(rec) for rec in raw_records]
    
    # Resulting first record:
    # {'user_id': 101, 'username': 'jdoe88', 'email': 'tech@example.com', 'account_bal': 1500.5, 'status': 'active'}
    

    Next steps

    1. Pass the cleaned_records list to your database cursor or ORM.
    2. Verify that string-based joins on the username field now match correctly.
    3. Wrap the cleaning logic in a generator if processing multi-gigabyte CSV files.

    csv-cleaner-skill.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

    The problem

    CSV exports from enterprise tools often include leading or trailing whitespace that breaks database joins and string comparisons. Manually stripping these characters across large datasets is repetitive and error-prone.

    What it does

    • Trims whitespace from every string value in a dictionary record.
    • Preserves non-string data types like integers and floats without modification.
    • Returns a new dictionary to maintain immutability and prevent side effects.
    • Maintains original keys exactly as they appear in the source.

    Frameworks & tools

    Python 3.x, CSV module, Pandas, and any dictionary-based data pipeline.

    Why this beats prompting it yourself

    This skill provides a standardized implementation that handles type checking correctly. Instead of generating one-off list comprehensions or lambda functions that might fail on nulls or non-string types, you get a predictable utility for your data scripts.

    Use cases

    • Sanitizing records from csv.DictReader before database insertion.
    • Preprocessing string keys before performing a join between two datasets.
    • Normalizing untrusted user uploads in a web backend.
    • Preparing clean dictionaries for conversion into Pandas DataFrames.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    2 installs

    Downloaded by developers to date

    Free forever

    No account required to browse

    Trust & safety

    Security scanned

    Verified clean 24 days ago

    • Free to download with an account

    Listed24 days ago

    What's inside

    Frequently Asked Questions