dataframe-dataclass-converter

Convert between pandas DataFrames and Python dataclasses bidirectionally.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Wkayaobama/icalps_pipeline --skill dataframe-dataclass-converter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dataframe-dataclass-converter
Source: https://github.com/Wkayaobama/icalps_pipeline/tree/main/Documents/AnthonySalesOps/Codebase/IC_Load/dataframe-dataclass-converter
Command: npx skills add https://github.com/Wkayaobama/icalps_pipeline --skill dataframe-dataclass-converter

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, and includes scripts (resource) components.

What problem does it solve?

Converting between flexible pandas DataFrames and structured Python dataclasses often involves manual mapping, leading to boilerplate code and potential type errors. This Skill automates bidirectional conversion, ensuring type safety and reducing development effort, so you can focus on data logic.

Core Features & Use Cases

  • DataFrame to Dataclass: Transform SQL query results (as DataFrames) into lists of type-safe Python dataclass instances, ideal for object-oriented data manipulation.
  • Dataclass to DataFrame: Convert lists of dataclass objects back into DataFrames for further processing with tools like DuckDB or for saving to CSV.
  • Use Case: After extracting data into a pandas DataFrame, use this skill to convert it into a list of Case dataclass objects, allowing for object-oriented manipulation and validation in your Python application.

Quick Start

Convert the attached pandas DataFrame 'sales_data_df' into a list of 'SaleRecord' dataclass instances.