A professional Python package to convert XMind mind maps into multiple formats (Markdown, CSV, Notion, Neo4j) with a unified command-line interface.
- Single Command Interface - One
xmind-convertcommand for all formats - Multiple Output Formats
- Markdown with wiki-style links
- CSV with hierarchical columns
- Notion database pages with relationships
- Neo4j graph database with hierarchical nodes
- Professional Package Structure - Proper Python package with pip installation
- Preserves Structure - Maintains parent-child relationships and hierarchy
- Type Hints & Documentation - Fully typed and documented codebase
- Flexible Configuration - Environment variables, config files, or CLI options
# Clone the repository
git clone https://github.com/MarlinZH/xmind_converter.git
cd xmind_converter
# Install the package
pip install -e .
# Or install with development dependencies
pip install -e ".[dev]"# Convert to Markdown
xmind-convert input.xmind markdown
# Convert to CSV
xmind-convert input.xmind csv --output ./data
# Convert to Notion
xmind-convert input.xmind notion --token YOUR_TOKEN --database-id YOUR_DB_ID
# Convert to Neo4j
xmind-convert input.xmind neo4j --uri bolt://localhost:7687 --username neo4j --password passxmind_converter/
βββ xmind_converter/ # Main package
β βββ __init__.py # Package initialization
β βββ cli.py # Unified CLI interface
β βββ core/ # Core functionality
β β βββ parser.py # XMind parsing logic
β β βββ config.py # Configuration management
β βββ converters/ # Format converters
β βββ base.py # Base converter class
β βββ markdown.py # Markdown converter
β βββ csv.py # CSV converter
β βββ notion.py # Notion converter
β βββ neo4j.py # Neo4j converter
βββ config/ # Configuration templates
β βββ notion_credentials.example.py
β βββ neo4j_credentials.example.py
βββ tests/ # Unit tests (coming soon)
βββ setup.py # Package setup
βββ requirements.txt # Dependencies
βββ README.md # This file
# Notion
export NOTION_TOKEN="secret_your_token"
export NOTION_DATABASE_ID="your_database_id"
# Neo4j
export NEO4J_URI="bolt://localhost:7687"
export NEO4J_USERNAME="neo4j"
export NEO4J_PASSWORD="your_password"# Copy templates
cp config/notion_credentials.example.py config/notion_credentials.py
cp config/neo4j_credentials.example.py config/neo4j_credentials.py
# Edit with your credentials
nano config/notion_credentials.py
nano config/neo4j_credentials.py# Pass credentials directly
xmind-convert input.xmind notion --token TOKEN --database-id DB_ID
xmind-convert input.xmind neo4j --uri URI --username USER --password PASS# Basic conversion
xmind-convert mymap.xmind markdown
# Specify output directory
xmind-convert mymap.xmind markdown --output ./docs
# With verbose logging
xmind-convert mymap.xmind markdown --verboseOutput: Markdown file with wiki-style [[links]]
# Basic conversion
xmind-convert mymap.xmind csv
# Specify output directory
xmind-convert mymap.xmind csv --output ./dataOutput: CSV file with hierarchical columns (Level 1, Level 2, etc.)
# Using environment variables
xmind-convert mymap.xmind notion
# Using CLI options
xmind-convert mymap.xmind notion \\
--token "secret_abc123..." \\
--database-id "1234567890abcdef"Requirements:
- Create Notion integration at https://www.notion.so/my-integrations
- Share your database with the integration
- Get database ID from URL:
https://notion.so/workspace/DATABASE_ID?v=...
# Using environment variables
xmind-convert mymap.xmind neo4j
# Using CLI options
xmind-convert mymap.xmind neo4j \\
--uri bolt://localhost:7687 \\
--username neo4j \\
--password mypassword
# Custom relationship type
xmind-convert mymap.xmind neo4j --relationship CONTAINSYou can also use the package programmatically:
from xmind_converter.core.parser import XMindParser
from xmind_converter.converters import MarkdownConverter, CSVConverter
# Parse XMind file
parser = XMindParser("input.xmind")
# Convert to Markdown
markdown_converter = MarkdownConverter(parser)
output_path = markdown_converter.convert(output_dir="./docs")
print(f"Saved to: {output_path}")
# Convert to CSV
csv_converter = CSVConverter(parser)
output_path = csv_converter.convert(output_dir="./data")
print(f"Saved to: {output_path}")
# Access parser data
print(f"Root topic: {parser.root_title}")
print(f"Max depth: {parser.get_max_depth()}")
print(f"All topics: {parser.get_all_topics()}")
# Get as DataFrame
df = parser.to_dataframe()
print(df.head())# Run tests (coming soon)
pytest
# Run with coverage
pytest --cov=xmind_converter
# Type checking
mypy xmind_converter
# Code formatting
black xmind_converter# Clone and install in editable mode
git clone https://github.com/MarlinZH/xmind_converter.git
cd xmind_converter
pip install -e ".[dev]"
# Install pre-commit hooks (if configured)
pre-commit install# Format code
black xmind_converter
# Lint code
flake8 xmind_converter
# Type check
mypy xmind_converter
# Run tests
pytestxmind-convert INPUT FORMAT [OPTIONS]
Arguments:
INPUT Path to XMind file (.xmind)
FORMAT Output format: markdown, csv, notion, neo4j
Global Options:
-o, --output DIR Output directory (for file formats)
-v, --verbose Enable verbose logging
-h, --help Show help message
Notion Options:
--token TOKEN Notion API integration token
--database-id ID Notion database ID
Neo4j Options:
--uri URI Neo4j database URI
--username USER Neo4j username
--password PASS Neo4j password
--relationship TYPE Relationship type (default: HAS_CHILD)
Import Error: No module named 'xmind_converter'
# Make sure you installed the package
pip install -e .Command not found: xmind-convert
# Reinstall the package to register the entry point
pip install --force-reinstall -e .Notion API authentication failed
- Verify your integration token is correct
- Ensure the database is shared with your integration
- Check that the database ID is correct
Neo4j connection refused
- Verify Neo4j is running:
neo4j status - Check the URI format:
bolt://localhost:7687 - Confirm username and password are correct
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests if applicable
- Run code formatters and linters
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE file for details
- Add comprehensive unit tests
- Add GitHub Actions CI/CD
- Support for more output formats (JSON, XML)
- Batch processing multiple files
- Custom templates for Markdown output
- Web-based interface
- Plugin system for custom converters
- Docker containerization
- PyPI package publication
- π Bug Reports: Open an issue
- π‘ Feature Requests: Open an issue
- π Documentation: Check this README and inline code documentation
- Built with xmindparser
- Uses Notion SDK
- Powered by Neo4j Python Driver
Made with β€οΈ by MarlinZH