This document describes how the development environment was set up for the Obsidian-Supernote Sync Tool.
- Python Version: 3.11.9
- Operating System: Windows
- Project Location:
C:\Edwin\repos\obsidian-supernote-sync - Virtual Environment:
venv/
obsidian-supernote-sync/
├── obsidian_supernote/ # Main Python package
│ ├── __init__.py
│ ├── cli.py # Command-line interface
│ ├── converters/ # File format converters
│ │ └── __init__.py
│ ├── parsers/ # File format parsers
│ │ └── __init__.py
│ ├── sync/ # Sync engine
│ │ └── __init__.py
│ └── utils/ # Utilities
│ └── __init__.py
├── tests/ # Test suite
│ └── test_basic.py
├── docs/ # Documentation
├── examples/ # Example configs
│ └── config.example.yml
├── requirements.txt # Dependencies
├── pyproject.toml # Project metadata
├── .gitignore # Git ignore rules
├── .env.example # Environment variables template
├── README.md # Project overview
└── SETUP.md # This file
Created and activated:
python -m venv venv
source venv/Scripts/activate # Windows Git Bash
# or
venv\Scripts\activate.bat # Windows CMDCore dependencies:
supernotelib(0.6.4) - Supernote .note file libraryPillow- Image processingpython-dotenv- Environment variablespyyaml- YAML config filesweasyprint- Markdown to PDF conversionmarkdown- Markdown parsingrich- Beautiful CLI outputclick- CLI frameworkwatchdog- File monitoringhttpx- HTTP client for cloud syncaiofiles- Async file I/O
Development dependencies:
pytest- Testing frameworkpytest-asyncio- Async test supportpytest-cov- Code coverageblack- Code formattingruff- Lintingmypy- Type checkingtypes-pyyaml- Type stubs
Installed in editable mode:
pip install -e .pytest tests/test_basic.py -vOutput:
- ✅ test_version PASSED
- ✅ test_author PASSED
obsidian-supernote --version
# Output: obsidian-supernote, version 0.1.0-alpha
obsidian-supernote --help
# Shows all available commandsThe CLI currently has these commands (all stubs, ready for implementation):
- md-to-pdf - Convert Markdown to PDF for Supernote
- note-to-md - Convert Supernote .note to Markdown
- sync - Bi-directional sync (full sync engine)
- status - Show sync status
- inspect - Inspect .note file structure
- init - Initialize configuration
-
Implement .note File Parser
- Create
obsidian_supernote/parsers/note_parser.py - Use
supernotelibto read .note files - Extract metadata, PNGs, and handwriting data
- Test with real .note files from Supernote device
- Create
-
Implement Markdown to PDF Converter
- Create
obsidian_supernote/converters/markdown_to_pdf.py - Use
weasyprintorpandocfor conversion - Optimize for Supernote display (A5/A6 size, e-ink friendly)
- Add styling support
- Create
-
Implement PDF to PNG Converter
- Create
obsidian_supernote/converters/pdf_to_png.py - Convert PDF pages to 1920x2560 PNG images
- Prepare for embedding in .note files
- Create
-
Experimental: .note File Creator
- Create
obsidian_supernote/converters/note_creator.py - Implement three-section .note file structure:
- Binary header with metadata
- Embedded PNG pages
- ZIP archive with minimal handwriting data
- Test on actual Supernote device
- Create
Before testing on real device:
- Backup all existing .note files
- Test with disposable notes first
- Verify .note file integrity
- Test on Supernote device
- Verify can open, edit, save without corruption
Issue: The project documentation mentioned supernote-lite, but it requires Python >=3.13
Solution: Using supernotelib (version 0.6.4) instead, which works with Python 3.11+
supernotelib is the PyPI package for the supernote-tool project, which provides:
- .note file parsing
- Conversion to PNG, SVG, PDF, TXT
- Text extraction from recognition data
- All features needed for the project
Note: Pandoc is NOT a Python package. It must be installed separately:
- Download from: https://pandoc.org/installing.html
- Or use package manager:
choco install pandoc(Windows)
Alternatively, use weasyprint which is a Python-native solution (already installed).
pytest
pytest -v # verbose
pytest --cov # with coverageblack obsidian_supernote/ruff check obsidian_supernote/mypy obsidian_supernote/-
Copy example files:
cp .env.example .env cp examples/config.example.yml config.yml
-
Edit
.envwith your credentials and paths -
Edit
config.ymlwith your sync preferences
- Windows CMD: Use
venv\Scripts\activate.bat - Windows PowerShell: Use
venv\Scripts\Activate.ps1 - Git Bash: Use
source venv/Scripts/activate
- Ensure virtual environment is activated
- Reinstall in editable mode:
pip install -e .
- Check Python version:
python --version(should be 3.10+) - Verify dependencies:
pip list
Setup Date: 2025-01-14 Python Version: 3.11.9 Status: ✅ Development environment ready