Python Music-Browser
A lightweight and modular python library to query tracks and their metadata from various sources.
Plugins features
Browse tracks
You can use plugin to issue any tracks provider (like Spotify) a query.
from music_browser.plugins import SpotifyPlugin
spotify = SpotifyPlugin(
client_id="97e316da02e94644b332c3ad77554c68", client_secret="9b999c62cf324a428a335a7d87b3d0a9"
)
tracks = spotify.search(query)
for simple_track in tracks:
print(simple_track)
As a result you will get a list of SimpleTrack, an object containing most basic properties of a track.
Complete track metadata
Coming soon...
Make your own plugin
First of all, your plugin should inherit from the Plugin base class.
You will have to implement the following methods.
from typing import List, Set
from music_browser.plugins import Plugin
from music_browser.models import SimpleTrack, FullTrack
class DeezerPlugin(Plugin):
@property
def known_fields(self) -> Set[str]:
# indicates list of field that your plugin can return
return {"title", "artist", "album"}
def complete(self, simple_track) -> FullTrack:
# workout full track properties
return FullTrack(...)
def search(self, query) -> List[SimpleTrack]:
# workout search results
return [SimpleTrack(...), ..., SimpleTrack(...)]
Objects structure
SimpleTrack
A SimpleTrack object has the following structure. It is returned when a list of tracks is asked to give a quick preview of each track. If later you would like to query more details, refere to FullTrack.
simple_track.__json__()
{
"title": "Lovers On the Sun (Metal Version)",
"artist": "UMC",
"album": "Lovers On the Sun (Metal Version)",
"cover": "https://i.scdn.co/image/ab67616d0000b273fa786b81f34442a68738be05",
"source": {
"id": "5fVCKGCQcZ1VPJNZrWqCO0",
"platform": "spotify"
}
},
FullTrack
Coming soon...
Roadmap
- Add ability to search in SoundCloud by adding a new plugin.
- Prototype advanced metadata-completion for a SimpleTrack.
- Study ability to use multiple search_plugins at once in browser.
- Study where cache would be interesting to optimise performances.
Changelog
0.0.4 Document package (2020-11-30)
- Add users and contributors documentation to README.
- Add commons metadata used by PyPI.
- Add licensing information.
0.0.3 First release (2020-11-30)
- Initiate plugins structure.
- Add search feature for
SpotifyandDeezerplugins. - First attempt to specify plugin interface
- Setup CI/CD for the project
- Simple integration on
masterandintegrationbranches. - Full integration before release, testing all supported python versions.
- Simple integration on
Metadata
Release files for music-browser 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| music-browser-0.0.4.tar.gz | 6.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| music_browser-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.5 kB
Release files / music-browser-0.0.4.tar.gz
| Download URL | music-browser-0.0.4.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b947ba657ed0b204f357c53014294464d7f638c25729e60a243149f73fa905b3
|
|
BLAKE2b-256 checksum How to use checksums |
1ad5f9f2d24c9d5e9527f9f1801a9d4a75f71ae87f5df101a0d3e9bc7e683dd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.5.10
|
Release files / music_browser-0.0.4-py3-none-any.whl
| Download URL | music_browser-0.0.4-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47ea9d240b3ccacc2fb2d54cdcf5c625a1788f253226acf7a3c960219aa71285
|
|
BLAKE2b-256 checksum How to use checksums |
f94fe1d9b3b74d37150cf315f4c6b17e452d2fc5a81946e18e1d2629361fca6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.5.10
|
Security for music-browser 0.0.4
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.