Design and implement a small-scale version of a music metadata processing system using Python, SQL, and optionally Google Cloud Platform (GCP) technologies. The system should be able to consume data from MusicBrainz, process it, and supply it to a client.

Core Task Details:

Implement a simple API using Python that allows a client to search for Imagine Dragons song by title and returns the corresponding metadata from the PostgreSQL database populated by the separate script which get data from MusicBrainz and normalise it (see point 1). This could be a RESTful API using a framework like Flask or FastAPI or simple CLI tool.

Example Input: Demons Output: Demons, Imagine Dragons, Night Visions, 2.58

  1. Data Source: Use the MusicBrainz API as your data source. The data should include the following fields: song title, artist name, album name, and length. Write a Python script that fetches data from MusicBrainz, processes it (e.g., pick the most relevant record for the song among tens or hundreds of similar records, cleans up the data, etc), and stores it in a PostgreSQL database. Here is the loom explaining the API and how to search for data to populate DB. but this is just an proposal, feel free to come up with your own design and solution:

https://www.loom.com/share/a5e1a91fcee04caf9b5b962d2e215c93

  1. Python Library: You should use the musicbrainzngs Python library to interact with the MusicBrainz API. Example:
import musicbrainzngs

# Configure the musicbrainzngs client
musicbrainzngs.set_useragent("ExampleApp", "0.1", "<http://example.com>")

# Search for Imagine Dragons artist ID
artist_search_result = musicbrainzngs.search_artists(artist="Imagine Dragons", limit=1)

Optional Advanced Components:

  1. Cloud Deployment: Containerize your application using Docker and deploy it on Google Compute Engine (GCE) or Google Kubernetes Engine (GKE). This step is optional and for candidates who are comfortable with GCP.
  2. Demo Recording: Create a short video recording demonstrating the functionality of your application.
  3. Tests: Write unit tests for your Python scripts and API endpoints. This step is optional and aimed at candidates who wish to showcase their ability to thoroughly test their code.
  4. Observability: Implement basic observability features using DataDog, Grafana, or Google Cloud's operations suite. This step is optional and aimed at candidates with experience in observability tools.

Deliverables: