Skip to main content

Helpfeel Cosense (Scrapbox) to Notion Migration Tool

Project description

sb2n

PyPI Release Package CI

Helpfeel Cosense (Scrapbox) to Notion Migration Tool

Installation

pip install sb2n
# or, (use as CLI only)
pipx install sb2n

Usage

1. Set up environment variables

Create a .env file in your project directory. (See: .env.example)

2. Prepare Notion Database

Create a database in Notion with the following properties:

  • Title (Title) - Page title
  • Scrapbox URL (URL) - Link to original Scrapbox page
  • Created Date (Date) - Original creation date
  • Tags (Multi-select) - Tags from Scrapbox

Screenshot

3. Run migration

# Basic migration
sb2n migrate

# Specify custom .env file
sb2n migrate --env-file /path/to/.env

# Dry run (no actual changes)
sb2n migrate --dry-run

# Migrate only first 10 pages
sb2n migrate -n 10

# Skip pages that already exist in Notion
sb2n migrate --skip-existing

# Combine options: dry run with limit and skip existing
sb2n migrate --dry-run -n 5 --skip-existing

# Enable verbose logging
sb2n -v migrate

4. Restore internal links

After migration, restore Scrapbox internal links ([PageName] format) to actual Notion page mentions:

# Restore links in all pages
sb2n restore-link

# Dry run (preview changes without applying)
sb2n restore-link --dry-run

# Restore links in specific pages only
sb2n restore-link --pages "HomePage,Getting Started"

# Enable verbose logging
sb2n -v restore-link

Appendix 1. Export as Markdown with images

Export Scrapbox pages to Markdown format with downloaded images. Images are saved in an assets/ directory and referenced with relative paths in the Markdown files.

# Export to default directory (./out)
sb2n export

# Specify output directory
sb2n export -d /path/to/output

# Limit number of pages to export
sb2n export --limit 10

# Combine options
sb2n export -d ./my-export --limit 5

# Enable verbose logging
sb2n -v export

Structure of extracted data

output-dir/
├── assets/              # Downloaded images
│   ├── abc123def456.png
│   ├── 789ghijk012.jpg
│   └── ...
├── page1.md            # Markdown files
├── page2.md
└── ...

Development

See docs/specification.md for detailed specifications.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sb2n-0.1.1.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sb2n-0.1.1-py3-none-any.whl (38.3 kB view details)

Uploaded Python 3

File details

Details for the file sb2n-0.1.1.tar.gz.

File metadata

  • Download URL: sb2n-0.1.1.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for sb2n-0.1.1.tar.gz
Algorithm Hash digest
SHA256 467cec6a621efcea46e37547ea7d1ba80485d9a864412e62a21043d5c0c65980
MD5 5dbcfab6265b70df7d7bf1f55682d2f7
BLAKE2b-256 2f2e6dd2218a2797de3a1c3cfb0785d7d83a1ddf99fa51b5e8774eb7b9f26a69

See more details on using hashes here.

File details

Details for the file sb2n-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sb2n-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 38.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for sb2n-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5dd5774436ef5079d4e493f1436f49af4bd168bebba20a1d4d3b28136d36fea4
MD5 b46ef2dc4c391a45df0aaf8407d4aa3c
BLAKE2b-256 c4f943d59069cb9f22f5e880dd9b543ef34f063e64e634519b0937c3f33ea7fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page