(unofficial) Python API for VGMusic. This project is in no way affiliated with or sponsered by Mike Newman or any of the staff at VGMusic.
vgmusic.py relies heavily on caches to avoid downloading VGMusic pages repeatedly; the CLI auto-caches for you into a cache.json
file.
An example of a cache file is at the root of this repo; it is a pre-parsed full dump of info (direct links, authors, etc.) on all the songs currently on VGMusic. It weighs in at 8.5 MB as JSON (6 MB without indentation).
Thoughout these examples, we will be using the API
object as the api:
import vgmusic
api = vgmusic.API()
It is recommended to close it once you are done:
# do something here...
api.close()
The best way is to use a context manager, a.k.a with
statement:
with vgmusic.API() as api:
# do something here
Note that the API is lazy: It will only retrieve data for a console/system the first time it is queried for it.
To override this behaviour, use force_cache
(see Module Documentation).
See API.md.
The command-line interface can be used to download MIDI files concurrently (useful for scripting).
Make sure to install the CLI extra first:
pip install vgmusic[cli]
For more info on how to use the cli, run vgmusic --help
.
Install the rest extension:
pip install vgmusic[rest]
and start the server with python3 -m vgmusic.rest
.
For docs, visit here once you've started the server.
MIT.