2008-Untangled / Music-Service-API

Microservice for providing song information to the Untangled app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Music-Service-API

Contributors Forks Stargazers Issues

Music Service API

This is a microservice that was built to provide music information to the Untangled application. When receiving a request for a song, this microservice consumes the Spotify API, complies the relevant information, and returns that information in the response.
Explore the docs »

· Report Bug · Request Feature

Table of Contents

  1. About This Project
  2. Virtual Environment setup
  3. Endpoint
  4. Testing
  5. Contributing
  6. Contact

About This Project

Visit Untangled to view all the repositories associated with this application.

This microservice allows you to query a song name and receive a response that includes the song name, artist name, album name, album release date, and a url for that song on spotify. It takes in the song name query, then consumes the Spotify API to get information about that song. The relevant information for that song is then extracted and compiled, and then returned in the microservice response.

Virtual Environment setup

# build a virtual environment to install your Python packages
python3 -m venv ./venv

# 'activate' the virtual environment for your project
# do this every time you start a new terminal and enter your project folder
source venv/bin/activate

# install your Python packages
pip3 install -r requirements.txt

#set your Spotify API keys
export SPOTIFY_CLIENT_ID=<your client id here>
export SPOTIFY_CLIENT_SECRET=<your client secret here>

To shut off your virtual environment, run deactivate at a terminal where you have an active virtual environment.

Endpoint

Search for a track: http://127.0.0.1:5000/api/v1/track?<track_name_here>

Example Valid Query:

GET http://127.0.0.1:5000/api/v1/track?yesterday

Response:

{
  "data": {
    "album_name": "Help! (Remastered)",
    "album_release_date": "1965-08-06",
    "artist_name": "The Beatles",
    "song": "Yesterday - Remastered 2009",
    "url": "https://open.spotify.com/track/3BQHpFgAp4l80e1XslIjNI"
  }
}

Example Empty Query:

GET http://127.0.0.1:5000/api/v1/track?

Response:

{
  "error": 422,
  "message": "Unprocessable Entity, please try another song title"
}

Example Invalid Query:

GET http://127.0.0.1:5000/api/v1/track?asdfgasdfgasd

Response:

{
  "message": "Unprocessable Entity, please try another song title",
  "status": 422
}

Testing

To run tests first activate your virtual environment with source venv/bin/activate
Then run python3 -m pytest

See Open Issues or visit our Project Board for a list of proposed features, known issues, and project extensions.

Contributing

Contributions are what make this community such an amazing and fun place to learn, grow, and create! Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch git checkout -b feature/NewGreatFeature
  3. Commit your Changes git commit -m 'Add some NewGreatFeature'
  4. Push to the Branch git push origin feature/NewGreatFeature
  5. Open a new Pull Request!

Contact

Bryce Jarrett      - LinkedIn - GitHub

Cameron Romo   - LinkedIn - GitHub

Joe Lopez           - LinkedIn - GitHub

Estelle Staffieri   - LinkedIn - GitHub

Grant Dempsey  - LinkedIn - GitHub

Eduardo Parra     - LinkedIn - GitHub

Jesse Mellinger   - LinkedIn - GitHub

Sean Steel           - LinkedIn - GitHub

Project Link: Untangled

About

Microservice for providing song information to the Untangled app.


Languages

Language:Python 99.4%Language:JavaScript 0.2%Language:CSS 0.1%Language:SCSS 0.1%Language:Mako 0.1%Language:C 0.1%Language:PowerShell 0.1%Language:HTML 0.0%Language:Shell 0.0%