dataframe-dataclass-converter

Community

Seamlessly convert DataFrames to type-safe dataclasses.

AuthorWkayaobama
Version1.0.0
Installs0

System Documentation

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.

Dependency Matrix

Required Modules

pandas

Components

scripts

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: dataframe-dataclass-converter
Download link: https://github.com/Wkayaobama/icalps_pipeline/archive/main.zip#dataframe-dataclass-converter

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.