Development/Summer of Code/2016: Difference between revisions

From MusicBrainz Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 131: Line 131:


== BookBrainz ==
== BookBrainz ==
[[Development/Summer_of_Code/BookBrainz|Ideas Page]]
Top 3 Desired Skills: Node.js, Python, SQL


BookBrainz is a database of book metadata, accessible at https://bookbrainz.org.
=== BookBrainz: Data Importing ===


This year we're interested in projects that help us get more data. The three suggested ideas to build proposals around are data importing, a web API and gamification of editing. Please see our [[Development/Summer_of_Code/BookBrainz|sub-project ideas page] for information on getting started and more details about the ideas themselves.
Proposed mentors: ''LordSputnik'' or ''Leftmost''<br>
Languages/skills: Browser JS, Node.js or Python, SQL/PostgreSQL<br>
[https://community.metabrainz.org/c/bookbrainz Forum for discussion]

At last year's summit, the two BookBrainz lead developers, Leftmost and LordSputnik worked on a plan for importing third party data into BookBrainz. This plan has several stages. First, data sources need to be identified, including mass import sources with freely available data, such as libraries, and manual import sources, such as online book stores and other user-contributed databases. The next stage is to update the database to introduce an "Import" object, which can be used to distinguish mass imported data from (usually better quality) user contributions. Then, actual import bots for mass import and userscripts for manual import will need to be written. Finally, it would desirable (but not necessary if time is short) to introduce an interface to the BookBrainz site to allow users to review automatically imported data, and approve it.

=== BookBrainz: Web API ===

Proposed Mentors: ''LordSputnik''/''Leftmost''<br>
Languages/skills: Node.js, ES6, Python, Redis, OAuth<br>
[https://community.metabrainz.org/c/bookbrainz Forum for discussion]

We’re currently in the process of switching to using Node.js for all server side code. As part of this, our schema has been redesigned, and the current Python-based web API will no longer work.

We'd like a new and improved JSON web API to be designed and implemented. The design would clearly describe the result of each different query to the web API, and give examples of output. It would also describe the workings of any additional features to be implemented - for example, authentication, caching and rate limiting. Authentication in the web API is a particular challenge, since the current MB OAuth setup requires a GUI.

The web API should be written using the koa.js Node.js server framework, so that the resulting code is as clean and minimal as possible. Tests should be written in parallel with the implementation, adapting and expanding on the tests for the existing Python web API. The priority for this task is a solid plan and quality code, not a complete implementation (although that would be nice!)

=== BookBrainz: Gamification ===

Proposed Mentors: ''LordSputnik''/''Leftmost''<br>
Languages/skills: Node.js, PostgreSQL<br>
[https://community.metabrainz.org/c/bookbrainz Forum for discussion]

Gamification involves adding reward to an activity to make it more fun and interesting for the participants by giving them something to aim for. In the context of BookBrainz, it could also help to ensure that editors are exposed to all the features of the site. We’d really like to introduce an achievement/badge system into BookBrainz, to complement our planned editor reputation system.

Some examples of possible achievements: adding X entities, leaving X comments on revisions, sending a message through the MeB messaging system, filling out profile bio, logging in/editing for X consecutive days.

To implement this, you'd need to introduce several database tables to store the types of achievement and the list of achievements earned by each editor. You’d also need to implement the site logic for unlocking badges, and code for displaying progress towards these on a user's profile. Unit tests for the new site code would also be beneficial.


== ListenBrainz ==
== ListenBrainz ==

Revision as of 23:20, 15 March 2016

Where to start

New to MetaBrainz?
List of MetaBrainz projects
New to MetaBrainz development and/or GSoC?
Getting started with GSoC
New to the idea of linked open data?
Linked open data article on wikipedia
Ready to apply?
GSoC applications @ community.metabrainz.org
Be aware of the content of our Development/Summer of Code/Application Template

Mentors

This year Robert Kaye, Michael Wiencek, Alastair Porter, Ben Ockmore, Sean Burke, and Roman Tsukanov will probably be amongst our mentors. That's ruaok (Robert), bitmap (Michael), alastairp (Alastair Porter), LordSputnik (Ben Ockmore), Leftmost (Sean Burke), and Gentlecat (Roman Tsukanov) on IRC, if you want to come and speak to us first. Some potential mentors are listed by each project; this is far from a normative list, but it might give you somebody to ask about the project.

Note: Contacting the mentors privately (e.g., via e-mail or private IRC messages) will get you off to a very, very bad start in your relations with us and any application you send us is now almost definitely going to not get accepted.

About proposals

Before you dive in and send a proposal to us through Google, it's a good idea to take some time and learn about the MusicBrainz community. At MusicBrainz we pride ourselves for having a strong community - most of us know each other in some way, and some of us know each other face to face from development summits.

A good way to get a feel of this would be to talk about your ideas and proposals on IRC. However, starting off by sending private messages to potential mentors is not a good way to introduce yourself to the community. Please don't do that!

If you're not sure where to start, Development/Summer of Code/Getting started might help.

MusicBrainz

Add social features to MusicBrainz

Proposed mentor: ruaok
Languages/skills: Perl and/or Python, Postgres
Forum for discussion

We recently added event (read: concerts) support to MusicBrainz. Our main motivation was to add this feature for historical concerts, but it can also be used for future concerts. In the past the crowd-sourced concerts on last.fm were the best place to find concerts, but in the past few years last.fm has begun to fade from people's awareness. There is a possibility that MusicBrainz can take the former place of last.fm and become the best crowd source concert information site on the net. In order for this to happen, we would need to add a few more features to MusicBrainz:

  • Social notifications: MB users should be able to post to Facebook/Twitter when they do plan to attend a concert.
  • Other features: What features should we add to build a community around concert information curation?

These social features are important for building a community of users around concerts. The goal is to engage users to enter information about concerts and venues and then talk about upcoming concerts. The more people use MusicBrainz to talk about concerts publicly, more people will get drawn in to improve the concert listings in MusicBrainz.

Implement genres based on tags in MusicBrainz

Proposed mentor: bitmap
Languages/skills: Perl, JavaScript (React), Postgres
Forum for discussion

Storing genre info in MusicBrainz has been discussed for years. Currently, we support arbitrary Folksonomy Tagging that users can apply to entities, and people have used that to store genres. But there's no way to tell if a tag is a genre or something else (like "seen live"). So, we've decided that the best way to support genres is to start with a hardcoded list of tags that we consider to be genres. This is documented at MBS-8600, and part of the project will be combining the sources there to come up with an appropriate list.

On top of that, we'd obviously like a way to present these tags as genres in the UI and web service. You should design and implement a UI for selecting genres for entities (with autocomplete), distinct from the normal tag list. You'd be using React for the editing interface. You also need to figure out how to modify our web service (Development/XML Web Service/Version 2) to indicate which tags are genres. (The web service is written in Perl.)

Additionally, come up with a way to manage our list of genres, possibly with support for aliasing them (e.g., if someone tags something as "aussie hip hop", it should be replaced by "australian hip hop"). This is where some familiarity with Postgres (coming up with a schema) will come in handy.

Redesign the artist overview pages on MusicBrainz

Proposed mentor: bitmap
Languages/skills: Perl, JavaScript (React)
Forum for discussion

Our artist pages are very boring and inaccessible right now. Example: https://musicbrainz.org/artist/b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d

We should be displaying release group cover art from the Cover Art Archive where possible (as an option, since people might prefer the current fast/compact view) and provide a better interface for filtering things, sort of like Discogs does in their left sidebar: https://www.discogs.com/artist/82730-The-Beatles Especially nice would be a way to show aggregate credits and filter release groups based on them (e.g. release groups where the artist has a vocal credit on any linked release or recording).

You should propose a new design including the features mentioned above and/or some of your own ideas. The musicbrainz-server codebase is written in Perl, and the current artist pages use Template Toolkit. You can use React to code the new templates, and use JavaScript to make the page "dynamic," but there should be fallbacks in place if JavaScript is disabled.

Replace [multiple] language with proper multiple languages

Proposed mentor: Bitmap
Languages/skills: Perl, SQL, PostgreSQL, Python
Forum for discussion

A variety of entities (at least Works and Releases) currently support linking it to a specific language, but a lot of entities are really composed of multiple different languages. This is currently "solved" by using '[Multiple languages]', but this leaves a lot of information left out: you can't tell exactly which languages are involved programmatically.

Changing this would require a lot of changes however, not only for the database schema, but also in the web service, our tagger Picard, and other things using the web service (programming libraries etc.). Not all of this needs necessarily be included in the GSoC project, but the impact of the project should be considered.

Integrate more *Brainz in more *Brainz

Languages/skills: Perl and/or Python and/or Node.js, probably SQL/PostgreSQL
Forum for discussion

We have a bunch of different projects under the MetaBrainz umbrella by now, but they do not necessarily utilise each other to their fullest extent. MusicBrainz in particular is lacking utilisation of features/data from e.g., AcousticBrainz and ListenBrainz.

I don't have any specific things to do or not do with this, but a prospective student thinking about this should definitely approach us on IRC and talk with us about what they have in mind and if there's anything the community can think of.

CritiqueBrainz

Performance improvements for CritiqueBrainz

Proposed mentor: Gentlecat
Languages/skills: Python, Flask, SQL, PostgreSQL
Forum for discussion

Currently CritiqueBrainz uses MusicBrainz web service to get information about release groups, artists, etc. CritiqueBrainz depends on this information heavily. Basically, every time we show a review, it needs to be accompanied by information about an entity (event or release group depending on what was reviewed). Unfortunately requests to the web service take significant amount of time, and there is no way to request info about multiple entities in one request. This slows down the website significantly, especially on pages where we show multiple (10-40) reviews.

One way to improve this is to query MusicBrainz database directly. Caching can help as well, and we already use it in some places. Once this problem is solved it should allow us to do more advanced things.

Improve database access in CritiqueBrainz

Proposed mentor: Gentlecat
Languages/skills: Python, Flask, SQL, PostgreSQL
Forum for discussion

From the start CritiqueBrainz server has been using SQLAlchemy ORM to interact with the database. Unfortunately, we started to notice that it adds too many constraints that we have to work around: writing complex queries and updating old ones is harder, caching becomes more complicated. Apart from this, there are a lot of implicit things that happen in background when you use an ORM. Database access code ended up spread out all over the place (even in templates).

It might be worth replacing all ORM usage in CritiqueBrainz with raw SQL queries, and improving code around it. We already have a similar implementation in AcousticBrainz project, which can be used as a reference.

AcousticBrainz

Proposed mentor: ruaok or alastairp
Languages/skills: Python, Postgres, Flask
Forum for discussion

AcousticBrainz is our new project that crowdsources acoustic information for all music in the world and to make it available to the public. We already have low-level information about more than three million tracks. What we need is a good way for users and developers to interact with all this data and help improve algorithms that are used to analyze it.

It would suit someone with experience or an interest in machine learning algorithms, though the majority of the project will probably involve creating infrastructure around our existing algorithms.

Ideas for this project are described on a separate page: AcousticBrainz/Ideas.

You can read more information about AcousticBrainz and some of the existing models that we have created on our blog.

Getting started

If you want to work on AcousticBrainz you should show that you are able to set up the server software and understand how some of the infrastructure works. Here are some things that we might ask you about

  • Install the server on your computer or use the Vagrant setup scripts to build a virtual machine
  • Download the AcousticBrainz submission tool and configure it to compute features for some of your audio files and submit them to the local server that you configured
  • Use your preferred programming language to access the API to download the data that you submitted to your server, or other data from the main AcousticBrainz server
  • Create an oauth application on the MusicBrainz website and add the configuration information to your AcousticBrainz server. Use this to log in to your server with your MusicBrainz details
  • Look at the system to build a Dataset (accessible from your profile page on the AcousticBrainz server) and try and build a simple dataset
  • Look at the list of tickets that we have open for AcousticBrainz and see if you understand what some of them mean. Feel free to ask questions about what they mean - some ticket descriptions don't have much detail

BookBrainz

Ideas Page Top 3 Desired Skills: Node.js, Python, SQL

BookBrainz is a database of book metadata, accessible at https://bookbrainz.org.

This year we're interested in projects that help us get more data. The three suggested ideas to build proposals around are data importing, a web API and gamification of editing. Please see our [[Development/Summer_of_Code/BookBrainz|sub-project ideas page] for information on getting started and more details about the ideas themselves.

ListenBrainz

ListenBrainz is one of the newest MetaBrainz projects. Read more information on its homepage.

Getting started

If you want to work on ListenBrainz you should show that you are able to set up the server software and understand how some of the infrastructure works. Here are some things that we might ask you about

  • Show that you understand the goals that ListenBrainz wants to achieve, which are written on its homepage
  • Install the server on your computer or use the Vagrant setup scripts to build a virtual machine
  • Create an oauth application on the MusicBrainz website and add the configuration information to your ListenBrainz server. Use this to log in to your server with your MusicBrainz details
  • Use the import script that is part of the ListenBrainz server to load scrobbles from last.fm to your ListenBrainz server, or the main ListenBrainz server
  • Use your preferred programming language to write a submission tool that can send Listen data to ListenBrainz. You could make up some fake data for song names and artists. This data doesn't have to be real.
  • Try and delete the ListenBrainz database on your local server to remove the fake data that you added.
  • Look at the list of tickets that we have open for ListenBrainz and see if you understand what tasks the tickets involve
  • If you want to, see if you can contribute to fixing a ticket. Either add a comment to the ticket or ask in IRC for clarification if you don't understand what the ticket means

Submission API compatible with Last.fm scrobblers

Proposed mentors: ruaok, alastairp, gentlecat
Languages/skills: Python
Forum for discussion

Right now ListenBrainz has its own API documented at https://listenbrainz.readthedocs.org/en/latest/. It'd be great if there were an additional web service layered on top of that one which spoke the Last.fm API, so it could be used as a proxy for existing Last.fm clients (ideally submitting the listens to both sites).

Statistics

Proposed mentors: ruaok, alastairp, gentlecat
Languages/skills: Python
Forum for discussion

User profiles on ListenBrainz are basically just a flat list of all your listens right now. We need to generate stats based on these listens: top artists (artist credits?), albums (release groups might be more useful than releases), recordings (works?), etc. Besides users, stats for the artists themselves would be nice (what was already mentioned, but as an aggregate across all users). This should be accomplished by streaming all of our data to Google's BigQuery and then building the needed systems to create statistics from that.

A way to associate listens with MBIDs

Proposed mentors: ruaok, alastairp, gentlecat
Languages/skills: Python
Forum for discussion

Last.fm is broken because of the terrible way it handles metadata (artists with the same name are jumbled into a single page; at the same time, there are often multiple pages for the same artist/album/track due to spelling variations). ListenBrainz is smarter by taking advantage of MBIDs. But there needs to be some sort of interface for identifying listens as being for a particular track (or recording) MBID. This could allow the user to identify an album they listened to on Spotify as the same one they listen to in iTunes a few days later. Then they wouldn't remain separate artists or albums in the stats due to differences in metadata alone.