Metadata-Version: 2.4
Name: streamlit-music-score
Version: 1.0.0
Summary: Streamlit helper to render MusicXML scores using OpenSheetMusicDisplay
Author-email: David Issa Mattos <issamattos.david@gmail.com>
License: MIT License
        
        Copyright (c) 2025 David Issa Mattos
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/davidissamattos/streamlit-music-score
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: streamlit>=1.32
Requires-Dist: music21>=9.1.0
Dynamic: license-file

# streamlit-music-score

Render MusicXML scores inside Streamlit using the
[OpenSheetMusicDisplay](https://opensheetmusicdisplay.org/) (OSMD) library.

You have three methods:
* `music_score` Feed a musicxml string directly
* `music_score_file` Read a file. It loads it first with music21. Accepts any file format that music21 accepts
* `music_score_stream` Parse a music21 object. Useful if you are doing transformations with music21 and just want to visualize the result.

OSMD play functionality is only available for sponsors at the moment. As soon as it is released to the public this demo will be updated also to include play controls.

## Quickstart

```bash
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cd 
streamlit run example_app.py
```

The demo loads the sample score at `examples/twinkle.musicxml` and lets you
upload your own MusicXML.

## Usage

```python
from streamlit_music_score import music_score, music_score_file, music_score_stream

xml = "<score-partwise>...</score-partwise>"  # MusicXML string from music21
music_score(xml, height=540)
```

### API
- `score_xml`: MusicXML string (UTF-8).
- `height`: Pixel height for the component (default `540`).
- `key`: Optional Streamlit widget key.
