Code Monkey home page Code Monkey logo

artist-network-application's Introduction

Artist Network Application - README

Overview

The Artist Network Application is a Flask-powered tool that creates a visual network of musical artists using the Spotify API, showcasing connections based on shared playlists and collaborations.

Features

  • Authentication: Users log in with their Spotify credentials.
  • Interactive Graph: Users can view an interactive graph depicting artist connections.
  • Artist Profiles: Detailed information about each artist, such as genres and popularity.
  • Search Functionality: Ability to search for and view specific artists' influence and profiles.
  • Popularity Insights: Insights into the most popular artists based on network connections.
  • Influence Metrics: Analysis of artists' influence within the network using centrality measures.
  • Extended Network Exploration: Users can explore broader artist connections.

Data Source and Interaction

Origin and Documentation Formats

Data is sourced from the Spotify Web API at various endpoints, returned in JSON format. Detailed endpoint URLs include:

  • Artist Details: https://api.spotify.com/v1/artists/{artist_id}
  • Playlist Artists: https://api.spotify.com/v1/playlists/{playlist_id}/tracks
  • Music Categories: https://api.spotify.com/v1/browse/categories
  • Category Playlists: https://api.spotify.com/v1/browse/categories/{category_id}/playlists

Access and Caching

Authenticated HTTP requests are used to access the data. Due to API rate limits, not all data is cached; only a subset is stored, primarily involving some music playlist graph files for efficient data retrieval and visualization.

Network Graph Organization

The network graph is structured with:

  • Nodes: Each representing an artist.
  • Edges: Existing between artists who appear together on two or more playlists. Artists featured together on only one playlist are not linked by an edge.

Data Summary and Variables

Data fetched from the Spotify API includes various attributes about artists and playlists:

  • Artist Attributes:

    • name: Name of the artist.
    • genres: List of genres the artist is associated with.
    • popularity: Popularity score of the artist on Spotify.

    Total variables per artist: 3

  • Playlist Attributes:

    • Each playlist item details the artists involved and their respective tracks.
  • Category Attributes:

    • Categories are identified by name and ID, providing a structured way to access playlists.
  • Variables Summary:

    • Total distinct artist-related variables: 3 (name, genres, popularity)
    • Additional data points include playlist names, track details, and collaborative links between artists.

Installation and Configuration

Prerequisites

  • Python 3.6+
  • Pip
  • Spotify Developer Account for API keys

Setup Instructions

  1. Obtain API Credentials:

    • Register on the Spotify Developer Dashboard.
    • Note your Client ID and Client Secret.
    • Set your redirect URI to http://127.0.0.1:5000/callback.
  2. Environment Setup:

    • Export your Spotify credentials or use a .env file:
      export SPOTIFY_CLIENT_ID='your_client_id'
      export SPOTIFY_CLIENT_SECRET='your_client_secret'
      
  3. Activate the Script:

    • Make the script executable and run it:
      chmod +x si507.sh
      ./si507.sh <env_name>
      
  4. Run the Application:

    • Launch the Flask app:
      flask run
      

Dependencies

The application requires several third-party Python packages:

  • Flask: To create and manage the web server.
  • Requests: For making HTTP requests to the Spotify API.
  • Networkx: To manage the graph structure representing artist relationships.
  • Bleach: For sanitizing inputs to prevent cross-site scripting attacks.

Install these packages using:

pip install -r requirements.txt

Usage

After installation, access the application at http://127.0.0.1:5000 in your web browser, log in with your Spotify credentials, and navigate the features through the web interface.

Support and Contributions

Consult the Spotify API documentation for usage details and limitations. For custom development or troubleshooting, refer to the source code documentation and the Flask framework guidelines.

artist-network-application's People

Contributors

xwyang457 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.