Unofficial Python API for vgmusic.com.
Project description
vgmusic.py
(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.
Caches
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).
Usage
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).
Module Documentation
See API.md.
CLI
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
.
REST
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.
License
MIT.
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 vgmusic-1.0.2.tar.gz
.
File metadata
- Download URL: vgmusic-1.0.2.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.25.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3803a3e4d40ff65023fd1bf1b6b1d3cc174aedeb06a0b32e848bf589d7f95cd3 |
|
MD5 | 19f6bf33861e1436d4536acc7209af12 |
|
BLAKE2b-256 | cebe5d0eee15ef990614e10eb3e75e37534bbfedfa9ef0d5b73eaf73c2bf4e0e |
File details
Details for the file vgmusic-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: vgmusic-1.0.2-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.25.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3800c455aa72cee30ea7459219b6872f996487b5723614c4cf7848c3bd84bc5 |
|
MD5 | 846d093426fa85f871adf7f43c70eb5d |
|
BLAKE2b-256 | 025c70e6ea95cd87de4cacc7d321ebe842cf5c0251cb7438bf112ba0a8bd1fb2 |