Skip to content
data-importer logo

Data Importer

data-importer

Import Synnovator platform data from .synnovator/*.md files into SQLite database via SQLAlchemy models. Use when need to populate test data, initialize database from file-based data, or migrate .synnovator content to relational database. Triggers include "import synnovator data", "populate databa...

SKILL.md

Full skill instructions

Data Importer

Import .synnovator/​*.md files (YAML frontmatter + Markdown body) into SQLite database via SQLAlchemy models.

Quick Start

# Import all data
python cli.py import \
  --source .synnovator \
  --db data/​synnovator.db \
  --models backend/​models

# Import specific types only
python cli.py import \
  --source .synnovator \
  --db data/​synnovator.db \
  --models backend/​models \
  --types user,post

# Full import (clear and reimport)
python cli.py import \
  --source .synnovator \
  --db data/​synnovator.db \
  --models backend/​models \
  --mode full

Workflow

  1. Validate inputs - Check paths exist and models can be loaded
  2. Load models - Dynamically import SQLAlchemy models module
  3. Import in order - Follow dependency graph (see import-order.md)
  4. Parse files - Extract YAML frontmatter and Markdown body
  5. Convert types - Map values to database column types
  6. Insert records - Batch insert with error handling
  7. Report results - Show imported/​skipped/​failed counts

Import Order

Data must be imported following foreign key dependencies:

  1. Phase 1: user, event, rule (independent types)
  2. Phase 2: group, post, resource (depend on user)
  3. Phase 3: interaction (depends on user and targets)
  4. Phase 4: All relations (depend on content types)

See references/​import-order.md for complete dependency graph.

Field Mapping

.md files use YAML frontmatter for structured fields and Markdown content for body text. The importer maps these to SQLAlchemy model columns with automatic type conversion:

  • datetime: ISO 8601 strings → datetime objects
  • JSON: Lists/​dicts → JSON strings
  • enum: Validates against allowed values
  • integer/​float: Strings → numbers
  • boolean: "true"/"false" → bool

See references/​mapping.md for complete field mappings for all 7 content types and 7 relation types.

Error Handling

  • Duplicate IDs: Skips records that already exist (incremental mode)
  • Missing fields: Reports validation errors
  • Foreign key violations: Reports missing references
  • Type errors: Shows conversion failures
  • Partial success: Continues importing after individual failures

Testing

Run the test suite:

cd scripts/
python test_importer.py

Tests validate:

  • Parsing .md files with YAML frontmatter
  • Type conversion logic
  • Import order correctness

Requirements

  • Python 3.8+
  • SQLAlchemy
  • PyYAML
  • SQLite database with tables matching .synnovator schema

Limitations

  • Only supports SQLite databases
  • Requires SQLAlchemy models to be importable
  • Does not generate missing tables (use Alembic migrations first)
  • Incremental mode skips duplicates by ID only

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View