Music search engine for CrossPlay web service.
Project description
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
Spotify
andDeezer
plugins. - First attempt to specify plugin interface
- Setup CI/CD for the project
- Simple integration on
master
andintegration
branches. - Full integration before release, testing all supported python versions.
- Simple integration on
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 music-browser-0.0.4.tar.gz
.
File metadata
- Download URL: music-browser-0.0.4.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b947ba657ed0b204f357c53014294464d7f638c25729e60a243149f73fa905b3 |
|
MD5 | c3257d8f0e8eb549cb09a85eb41f6962 |
|
BLAKE2b-256 | 1ad5f9f2d24c9d5e9527f9f1801a9d4a75f71ae87f5df101a0d3e9bc7e683dd7 |
File details
Details for the file music_browser-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: music_browser-0.0.4-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47ea9d240b3ccacc2fb2d54cdcf5c625a1788f253226acf7a3c960219aa71285 |
|
MD5 | ed8117936275372ef49e1b1da751714c |
|
BLAKE2b-256 | f94fe1d9b3b74d37150cf315f4c6b17e452d2fc5a81946e18e1d2629361fca6f |