# import-notion > Import Notion pages and databases to Obsidian with full markdown conversion and automatic hierarchical organization. Use when user wants to import from Notion, sync Notion content, migrate to Obsidian, or create local backups of Notion pages. - Author: David Lin - Repository: abundance-company/claude-code - Version: 20260122165217 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/abundance-company/claude-code - Web: https://mule.run/skillshub/@@abundance-company/claude-code~import-notion:20260122165217 --- --- name: import-notion description: Import Notion pages and databases to Obsidian with full markdown conversion and automatic hierarchical organization. Use when user wants to import from Notion, sync Notion content, migrate to Obsidian, or create local backups of Notion pages. argument-hint: [notion-page-url or page-id] disable-model-invocation: false allowed-tools: Bash, AskUserQuestion --- # Import Notion to Obsidian You are helping the user import content from Notion to Obsidian with full markdown fidelity and hierarchical organization. ## When to Use This Skill Use this skill when the user wants to: - Import a Notion page or workspace to Obsidian - Sync Notion databases to markdown - Migrate from Notion to Obsidian - Create local backups of Notion content - Import specific Notion pages by URL or ID - Organize imported content to match Notion's hierarchy ## What to Do 1. **Get the Notion page identifier** from user: - Ask: "What Notion page would you like to import? You can provide the page URL or page ID." - Extract page ID from URL if provided (format: `https://notion.so/page-name-{PAGE_ID}`) - Clean page ID: remove dashes if present (e.g., `29cf11ef-61b7-8008-a818-f279f0fab5bd` → `29cf11ef61b78008a818f279f0fab5bd`) 2. **Get the output directory**: - Ask: "Where in Obsidian would you like to save this? (e.g., 'Abundance' or 'Projects/Research')" - Construct full path: `~/Library/Mobile Documents/iCloud~md~obsidian/Documents/ObsidianVault/{their_answer}` - If user says "Obsidian" or "my vault", ask them to be more specific about the folder 3. **Verify Notion token is set**: ```bash source ~/.claude/.env echo ${NOTION_TOKEN:+Token is set} ``` If not set, tell the user they need to add NOTION_TOKEN to ~/.claude/.env 4. **Run the import**: ```bash python3 Data/import-notion/src/import_notion.py PAGE_ID OUTPUT_DIRECTORY ``` 5. **Report the results**: - The script automatically runs an evaluation after import - Review the evaluation report for: - Successfully imported pages and databases - Any failed imports - File verification (empty files, errors, missing content) - Overall success rate - Let the user know it's complete and where the files were saved - Mention that backups were created if files existed - Explain the folder structure (see Organization below) - If there are failed imports or errors, investigate and re-run if needed ## Important Notes - **Recursive by default**: Imports all child pages and databases - **Automatic hierarchy**: Pages with children get their own subdirectories - **Creates backups**: Existing folders are backed up before overwriting - **Notion access**: User must have shared pages with their Notion integration - **Page ID format**: Can be with or without dashes, script handles both ## Hierarchical Organization The skill automatically organizes content to match Notion's structure: - **Pages with children**: Create a subdirectory named after the page, with the parent page inside - Example: If "Klaus Specs" has 26 child pages, creates `/Klaus Specs/Klaus Specs.md` plus 26 child files - **Pages without children**: Remain at the current directory level - **Databases**: Always create subdirectories with entries inside - Example: "Reality Distortion - Seed IRM" database creates `/Reality Distortion - Seed IRM/` with 243 investor entries **Result**: Clean folder structure that mirrors Notion's page hierarchy, making navigation intuitive ## Import Verification & Evaluation After import completes, the skill automatically runs a comprehensive evaluation: ### What Gets Verified: 1. **Import Success Tracking**: - Counts successful page imports - Tracks failed imports with reasons - Records database imports with entry counts 2. **File Content Verification**: - Checks all markdown files exist - Verifies files have actual content (not just frontmatter) - Detects error messages in files - Identifies empty or minimal files 3. **Comprehensive Report**: - Import statistics (pages, databases, entries) - File verification results - Lists any failed imports with reasons - Shows empty files (may be legitimately empty in Notion) - Reports files with errors - Calculates overall success rate ### Example Evaluation Report: ``` ============================================================ 📋 IMPORT EVALUATION REPORT ============================================================ 📊 Import Statistics: ✅ Successfully imported pages: 84 ❌ Failed pages: 0 🗄️ Databases imported: 2 📄 Total database entries: 262 🔍 File Verification: 📁 Total files created: 346 ✅ Valid files with content: 320 ⚠️ Empty or minimal files: 3 ❌ Files with errors: 0 📝 Files missing content: 23 🗄️ Database Details: ✅ Reality Distortion - Seed IRM: 243 entries ✅ Library: 19 entries ============================================================ 📈 Overall Success Rate: 100.0% 📁 Output Location: /path/to/output ============================================================ ``` ### Using the Evaluation Results: - **100% success rate**: Import was perfect, all pages accessible - **Failed pages**: Review error reasons, may need to re-share pages with Notion integration - **Empty files**: Check if pages are actually empty in Notion (some pages may just be containers) - **Error files**: Re-run import or investigate Notion API issues ## Installation (if user needs setup) If this is the first time using the skill: ```bash # Install dependencies cd Data/import-notion pip install -r requirements.txt # User needs to set up Notion token in ~/.claude/.env: # NOTION_TOKEN="secret_xxxx..." ``` ## Troubleshooting - **"Notion token not found"**: User needs to add NOTION_TOKEN to ~/.claude/.env - **"Could not find page"**: Page ID may be wrong, or page not shared with integration - **"Permission denied"**: User needs to share the Notion page with their integration ## Example Invocation User: "Import my Abundance workspace from Notion" You: 1. Ask for the Notion page URL or ID 2. User provides: `https://notion.so/Abundance-29cf11ef61b78008a818f279f0fab5bd` 3. Extract ID: `29cf11ef61b78008a818f279f0fab5bd` 4. Ask where to save: User says "Abundance" 5. Run: `python3 Data/import-notion/src/import_notion.py 29cf11ef61b78008a818f279f0fab5bd ~/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/ObsidianVault/Abundance` 6. Report: "Successfully imported [X] pages and [Y] databases to Obsidian/Abundance!" ## Related Files - `src/import_notion.py` - Main import script - `README.md` - Full documentation for humans - `requirements.txt` - Python dependencies