ListenBrainz' empathic music recommendation/playlisting engine
Project description
Introduction
This project is part of ListenBrainz' open source music recommendation efforts with an API-first philiosophy. API-first means that user do no need to download a lot of data before they can start working with Troi -- all the needed data should ideally live in online APIs, making it very easy for someone to get started hacking on music recommendations.
Features
The troi engine features the following concepts:
- A pipelined architecture for creating playlists from any number of sources.
- Data sources that fetch data from APIs and feed the data into the troi pipelines.
- Pipeline elements that are connected together are called Patches. Troi includes a number of built-in patches.
- The largest patch implements ListenBrainz radio that can generate "radio style" playlists based on one or more artists, tags, user statistics, user recommendations, LB playlists and MB collections.
- Generated playlists are output in the JSPF format, the JSON version of XPSF playlists.
Troi is being used to generate weekly recommendations on ListenBrainz (weekly jams, weekly exploration) as well as LB Radio.
Data-sets
To accomplish this goal, we, the MetaBrainz Foundation, have created and hosted a number of data-sets that can be accessed as a part of this project. For instance, the more stable APIs are hosted on our Labs API page.
ListenBrainz offers a number of data sets:
- Collaborative filtered recordings that suggest what recordings a user should listen to based on their previous listening habits.
- User statistics that were derived from users recent listening habits.
- Listening stats that can be used as a measure of popularity.
- Similarity data for artists and recordings
We will continue to build and host more datasets as time passes. If an API endpoint becomes useful to a greater number of people we will elevate these API endpoints to officially supported endpoints that we ensure are up to date on online at all times.
The project is named after Deanna Troi.
Documentation
Full documentation for Troi is available at troi.readthedocs.org.
Installation for end users
Troi is available for download via PyPi.
Installation for Development
Linux and Mac
virtualenv -p python3 .ve
source .ve/bin/activate
pip3 install .[tests]
troi --help
Windows
virtualenv -p python .ve
.ve\Scripts\activate.bat
pip install .[tests]
troi --help
Basic commands
List available patches:
troi list
Generate a playlist using a patch:
troi playlist --print [patch-name]
If the patch requires arguments, running it with no arguments will print a usage statement, e.g.
$ troi playlist lb-radio
Usage: lb-radio [OPTIONS] MODE PROMPT
Generate a playlist from one or more Artist MBIDs
MODE which mode to generate playlists in. must be one of easy, mediumedium, hard
PROMPT is the LB radio prompt. See troi/parse_prompt.py for details.
Options:
--help Show this message and exit.
To generate an LB Radio playlist on easy mode with an artist and a tag, use the following:
troi playlist lb-radio easy "artist:(pretty lights) tag:(chillwave)"
The use the --upload and --token options to upload the playlist to ListenBrainz.
Running tests
troi test
troi test -v
troi test -v <file to test>
Building Documentation
To build the documentation locally:
pip install .[docs]
cd docs
make clean html
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 troi-2024.1.30.0.tar.gz
.
File metadata
- Download URL: troi-2024.1.30.0.tar.gz
- Upload date:
- Size: 95.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a1e424b6386937a5318ac9f3e3cb6519f19c9a6f57b3c9fdd9d505c66ff8c59 |
|
MD5 | bfa5fed1bacf8e88aec77ac86e2a1c87 |
|
BLAKE2b-256 | fe7329e78f5bcca5d500c9692f2f008d53dd3b552364c739e8a94acf14c77112 |
File details
Details for the file troi-2024.1.30.0-py3-none-any.whl
.
File metadata
- Download URL: troi-2024.1.30.0-py3-none-any.whl
- Upload date:
- Size: 88.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b512b2535f16fe1404dddce04504b35c688fec0c740c4595058ca48de81ed5ba |
|
MD5 | 1a3e753009fc239fb2c05fff16609f34 |
|
BLAKE2b-256 | 4af944538592f7a0ef1e9e2a77eb55eedc1d84b133a2909cbf2fa2af2e531603 |