This project is a command-line interface (CLI) application that allows users to fetch the top tracks of a given artist on Spotify. It utilizes the Spotipy library to interact with the Spotify Web API and Typer for the CLI component.
- Python 3.8 or higher
- A Spotify Developer account and your own Client ID and Client Secret for accessing the Spotify Web API
- Clone this repository to your local machine.
- Navigate to the cloned directory.
- It is recommended to create a virtual environment for this project:
python -m venv venv
- Activate the virtual environment:
- On Windows:
.\venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
- Install the required dependencies:
pip install spotipy typer
Before running the application, you need to set up your Spotify API credentials. Set your Client ID and Client Secret as environment variables:
- On Windows:
set SPOTIPY_CLIENT_ID=your_client_id_here
set SPOTIPY_CLIENT_SECRET=your_client_secret_here
- On macOS and Linux:
export SPOTIPY_CLIENT_ID=your_client_id_here
export SPOTIPY_CLIENT_SECRET=your_client_secret_here
To run the application, use the following command:
python main.py "artist name"