Skip to content

Latest commit

 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reMarkable OCR Lambda

Convert reMarkable tablet notebooks to markdown via Claude Vision.

Prose Desktop                          This Lambda
┌────────────────────┐                ┌─────────────────────────┐
│  Sync Button       │                │  .rm ──► Parse          │
│       │            │   POST /ocr    │       ──► Render PNG    │
│       ▼            │ ─────────────► │       ──► Claude Vision │
│  rmapi-js          │                │       ──► Markdown      │
│  Download .rm      │ ◄───────────── │                         │
└────────────────────┘    JSON        └─────────────────────────┘

How It Works

  1. Typed text — Extracted directly from .rm files (firmware v3.3+), no OCR needed
  2. Handwriting — Rendered to PNG, then OCR'd via Claude Vision API
  3. Mixed pages — Both methods combined, returned as unified markdown

API

POST /ocr

Headers

Header Required Description
x-api-key Yes Lambda authentication
x-anthropic-key For handwriting Your Anthropic API key (BYOK model)

Request

{
  "pages": [
    { "id": "page-uuid", "data": "<base64 .rm data>" }
  ]
}

Response

{
  "pages": [
    {
      "id": "page-uuid",
      "markdown": "# Meeting Notes\n\nDiscussed the Q1 roadmap...",
      "confidence": 0.92
    }
  ]
}

Errors

Code Description
401 Invalid or missing x-api-key
MISSING_ANTHROPIC_KEY Handwriting detected but no x-anthropic-key provided

Development

pip install -r src/requirements.txt   # Install deps
pytest                                 # Run tests
pytest tests/test_handler.py -v       # Single file
API_KEY=test-key ./scripts/test-local.sh path/to/page.rm

Deployment

# Infrastructure
cd terraform && terraform init && terraform apply

# Lambda code
./scripts/deploy.sh

Environment Variables

Variable Description
API_KEY_SECRET_ARN Secrets Manager ARN for Lambda auth key
API_KEY Local override for testing

Security

Bring Your Own Key (BYOK) — Users provide their Anthropic API key per-request via x-anthropic-key. Keys pass through to Anthropic but are never stored or logged. Typed-text-only pages skip Claude Vision entirely.

Dependencies

Package Purpose
rmscene Parse .rm v6 files
Pillow Render strokes to PNG
anthropic Claude Vision API
boto3 AWS Secrets Manager

Related

  • Prose — Writing app that consumes this API

About

AWS Lambda service that syncs reMarkable tablet notebooks to markdown via OCR

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages