pdf2mscz
Convert sheet-music scans (PDF / PNG / JPG) into editable MuseScore (.mscz) and MusicXML using a modular multi-provider pipeline: classical open-source OMR (oemer) + vision LLMs (OpenAI, Anthropic, Gemini, NVIDIA, Ollama).
Architecture
flowchart LR
IN[PDF/PNG/JPG] --> PRE[Preprocess: render, deskew, denoise]
PRE --> P{Provider}
P -->|openai/anthropic/gemini/nvidia/ollama| VLM[VLM → MusicXML]
P -->|oemer| OMR[Classical OMR → MusicXML]
OMR -->|optional --refine| VLM
VLM --> SAN[XML Sanitizer]
SAN --> XML[.musicxml]
XML -->|MuseScore CLI| MSC[.mscz]
XML -.fallback, no MuseScore.-> XML
Install
# PyPI — core plus the provider extra(s) you use:
pip install "pdf2mscz[openai]" # GPT-4o / OpenAI
pip install "pdf2mscz[anthropic]" # Claude
pip install "pdf2mscz[gemini]" # Google Gemini
pip install "pdf2mscz[nvidia]" # NVIDIA NIM hosted VLMs
pip install "pdf2mscz[ollama]" # local Ollama (no key needed)
pip install "pdf2mscz[oemer]" # classical local OMR
pip install "pdf2mscz[all]" # everything
# from source (development):
# python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev,all]"
cp .env.example .env # add API keys
See docs/setup.md for MuseScore/Ollama details.
Usage
# VLM transcription → .mscz (needs MuseScore CLI installed)
pdf2mscz convert scan.pdf score.mscz --provider openai --model gpt-4o
# Pages 1-3 only, with preprocessing
pdf2mscz convert scan.pdf score.mscz --provider anthropic --pages 1-3 --preprocess
# Classical local OMR, no API key
pdf2mscz convert scan.pdf score.musicxml --provider oemer --format musicxml
# Hybrid: oemer transcribed, GPT-4o refined
pdf2mscz convert scan.pdf score.mscz --provider oemer --refine openai
# Local VLM
pdf2mscz convert scan.pdf score.musicxml --provider ollama --model llava:13b --format musicxml
# NVIDIA NIM hosted VLM (free credits at build.nvidia.com)
pdf2mscz convert scan.pdf score.mscz --provider nvidia
pdf2mscz convert scan.pdf score.mscz --provider nvidia --model meta/llama-3.2-11b-vision-instruct
# Helpers
pdf2mscz providers
pdf2mscz check-deps
Python API
from pdf2mscz import ConversionOptions, convert
out = convert("scan.pdf", "score.mscz", ConversionOptions(provider="openai"))
print(out.musicxml_path, out.mscz_path)
License
AGPL-3.0-or-later (see License).
Release files for pdf2mscz 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pdf2mscz-0.1.0.tar.gz | 29.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pdf2mscz-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 64.1 kB
Release files / pdf2mscz-0.1.0.tar.gz
| Download URL | pdf2mscz-0.1.0.tar.gz |
|---|---|
| Size | 29.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5eff2e8766e2540a4f7e484ebf8c911b9a017f933408055307c8b397af38f180
|
|
BLAKE2b-256 checksum How to use checksums |
3c87d496045930aa05889571e923ad36dab38fc7b7ab6c698b8705ad96a6d4e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.
Transparency logRelease files / pdf2mscz-0.1.0-py3-none-any.whl
| Download URL | pdf2mscz-0.1.0-py3-none-any.whl |
|---|---|
| Size | 34.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e6d268b7f8a552851dc84400f5e45715737bb25d8cae005e46a7c774990bb76b
|
|
BLAKE2b-256 checksum How to use checksums |
51ca2aa36de5f64dfa3b98569ed4a123e59e2ffc348f62f353525f7acf101a67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.
Transparency log