[mus]escore [d]own[l]oader, ported from TypeScript
Project description
musdl
NOTE:
The author of musdl does NOT condone piracy in any way, and is not responsible for anything that happens as a result of piracy arising from the use of musdl.
musdl (musscore downloader) is a downloader for Musescore, written in Python. musdl can download scores as MP3, MIDI, MXL and PDF. PDFs are rendered from individual SVGs to A4 size using svglib, guaranteeing the highest resolution available.
For example, Gymnopédie No. 1.
It is meant to be used as a command-line tool, but can also be imported and used as a module:
from musdl import Score
my_score = Score(...) # the Musescore url goes here
data = my_score.download("mp3") # download as mp3, returns as bytes
Why?
musdl was inspired by musescore-downloader, which is written in TypeScript. But, what if you wanted to run it without a web browser? That's why I made a Python equivalent.
takedown request, et tu?
Take a look at this issue in the same repo.
Requirements
requests
- Downloader.beautifulsoup4
- Powerful HTML parser.
For downloading PDFs:
reportlab
- Make PDFs.svglib
- Convert SVGs into Reportlab drawings.
Hacking
All my python projects now use flit to build and publish.
So you need to python3 -m pip install flit
first.
git clone https://github.com/onyxware/musdl
cd musdl
flit build
Install
(python3 -m) pip install musdl
If you want to download PDFs, you need to install the pdf
extra:
(python3 -m) pip install musdl[pdf]
License
MIT.
Known Issues
MXL download is broken (there is no direct url, like PDF).
Changelog
2.3.0
Better PDF page detection (now the exact number of pages are known at runtime).
The attributes .user
, .id
, and .pages
have been added to the Score
class. (user and pages are self-explanatory, id is the score id.)
Added support for multi-threaded downloading of PDF pages (specify with -t
). Downloading (may) be faster.
2.2.2
Fixed PDF scaling issue on Windows.
2.2.1
Made PDF downloading a extra feature (because svglib
and reportlab
dependencies are not pure-Python).
2.2.0
Fixed PDF support for Windows. Now musdl uses svglib
as the backend for adding SVGs to PDFs.
2.1.1-2.1.2
Added PDF support.
2.0.0
Added -O
option to use the score's title as the output filename (y'know, like curl -O
).
Refactored code to be object-oriented, in the form of the Score
class. This should make adding new features easier.
(Plus, you can use musdl
more programmatically!)
1.1.2
Version bump, use Flit to build instead of setup.py
.
Updated README too.
1.1.0
Added MusicXML download option, thanks to JPFrancoia for the update!
1.0.0
Initial version.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file musdl-2.3.1.tar.gz
.
File metadata
- Download URL: musdl-2.3.1.tar.gz
- Upload date:
- Size: 427.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.24.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 996342e3c6383102ad2a489abf9c9c5df80aceaaf5d2e68e6f465fda15fa7b79 |
|
MD5 | f545eac71abda88240b5938f342171eb |
|
BLAKE2b-256 | 1dba9832e17c9ca0e96fe628f1a0701e6b8ce9fd440d8c780b47237654cdf352 |
File details
Details for the file musdl-2.3.1-py3-none-any.whl
.
File metadata
- Download URL: musdl-2.3.1-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.24.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffd1ad204814b0e861ace4b169a4247b0b5ea36793e53ba9aa9d9e32ec1f1f48 |
|
MD5 | 80caf72d875cc9b8afbb022594eb8616 |
|
BLAKE2b-256 | 0061efb8ff7e6f5bc24f1c1604c5eace9325ad7072a44e126be7c32dc9230408 |