Skip to content
Back to skills

Frappe Data Migration Generator

ASecurity

Generate data migration scripts for Frappe. Use when migrating data from legacy systems, transforming data structures, or importing large datasets.

  • 666 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added February 8, 2026
businesspythongit

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill frappe-data-migration-generator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Frappe Data Migration Generator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Frappe Data Migration Generator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-frappe-data-migration-generator/badge)](https://www.skillsdirectory.com/skills/majiayu000-frappe-data-migration-generator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: frappe-data-migration-generator
description: Generate data migration scripts for Frappe. Use when migrating data from legacy systems, transforming data structures, or importing large datasets.
---

# Frappe Data Migration Generator

Generate robust data migration scripts with validation, error handling, and progress tracking for importing data into Frappe.

## When to Use This Skill

Claude should invoke this skill when:
- User wants to migrate data from legacy systems
- User needs to import large CSV/Excel files
- User mentions data migration, ETL, or data import
- User wants to transform data structures
- User needs bulk data operations

## Capabilities

### 1. CSV Import Script

**Production-Ready CSV Importer:**
```python
import csv
import frappe
from frappe.utils import flt, cint, getdate

def import_customers_from_csv(file_path):
    """Import customers with validation and error handling"""
    success = []
    errors = []

    with open(file_path, 'r', encoding='utf-8-sig') as f:
        reader = csv.DictReader(f)

        for idx, row in enumerate(reader, start=2):
            try:
                # Validate required fields
                if not row.get('Customer Name'):
                    raise ValueError('Customer name required')

                # Transform data
                customer = {
                    'doctype': 'Customer',
                    'customer_name': row['Customer Name'].strip(),
                    'customer_group': row.get('Customer Group', 'Commercial'),
                    'territory': row.get('Territory', 'All Territories'),
                    'email_id': row.get('Email', '').strip(),
                    'mobile_no': row.get('Phone', '').strip(),
                    'credit_limit': flt(row.get('Credit Limit', 0))
                }

                # Check duplicate
                exists = frappe.db.exists('Customer',
                    {'customer_name': customer['customer_name']})

                if exists:
                    # Update
                    doc = frappe.get_doc('Customer', exists)
                    doc.update(customer)
                    doc.save()
                else:
                    # Insert
                    doc = frappe.get_doc(customer)
                    doc.insert()

                success.append(row['Customer Name'])

                # Commit every 100
                if len(success) % 100 == 0:
                    frappe.db.commit()
                    print(f"Processed {len(success)} records")

            except Exception as e:
                errors.append({'row': idx, 'data': row, 'error': str(e)})

    frappe.db.commit()
    return {'success': success, 'errors': errors}
```

## References

**Frappe Data Import:**
- Data Import: https://github.com/frappe/frappe/blob/develop/frappe/core/doctype/data_import/data_import.py
- CSV Utils: https://github.com/frappe/frappe/blob/develop/frappe/utils/csvutils.py

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.