spotifetch 0.4.4
A fetch tool for Spotify
License: MIT
Requires Python: >=3.9,<4.0

<h2 align="center"> ━━━━━━  ❖  ━━━━━━ </h2>

<!-- BADGES -->
<div align="center">
   <p></p>
   
   <img src="https://img.shields.io/github/stars/dotzenith/SpotiFetch?color=F8BD96&labelColor=302D41&style=for-the-badge">   

   <img src="https://img.shields.io/github/forks/dotzenith/SpotiFetch?color=DDB6F2&labelColor=302D41&style=for-the-badge">   

   <img src="https://img.shields.io/github/repo-size/dotzenith/SpotiFetch?color=ABE9B3&labelColor=302D41&style=for-the-badge">
   
   <img src="https://img.shields.io/github/commit-activity/y/dotzenith/SpotiFetch?color=96CDFB&labelColor=302D41&style=for-the-badge&label=COMMITS"/>
   <br>
</div>

<p/>

---

### ❖ Information 

  SpotiFetch is a simple fetch tool to display info about your Spotify profile using the spotify API

  <img src="https://github.com/dotzenith/dotzenith/blob/main/assets/SpotiFetch/spotifetch.gif" alt="spotifetch gif">

---

### ❖ Requirements

Register an app on the Spotify developer dashboard [here](https://developer.spotify.com/dashboard/)

Edit the app settings and set `http://127.0.0.1:9090` as the redirect URI

Take a note of your Client ID and Client Secret

Put the following in your `.bashrc` or `.zshrc` or the equivalent for your shell
```sh
export SPOTIPY_CLIENT_ID='insert-your-spotify-client-id-here'
export SPOTIPY_CLIENT_SECRET='insert-your-spotify-client-secret-here'
export SPOTIPY_REDIRECT_URI='http://127.0.0.1:9090'
```

---

### ❖ Installation

> Install from pip
```sh
$ pip3 install spotifetch
```

> Install from source
- First, install [poetry](https://python-poetry.org/)
```sh
$ git clone https://github.com/dotzenith/SpotiFetch.git
$ cd SpotiFetch
$ poetry build
$ pip3 install ./dist/SpotiFetch-0.4.3.tar.gz
```


### ❖ Usage 

If the instructions in the Requirements section are followed properly, SpotiFetch will ask you to log in and give permissions to fetch stats the first time it's used. Login is not required after the first use. 

```
Usage: spotifetch [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  profile      Fetch stats for the user profile
  top-artists  Fetch user's top artists
  top-tracks   Fetch user's top tracks
```


#### SpotiFetch can be used like any other fetch tool

```sh
$ spotifetch profile      # fetches profile stats
$ spotifetch top-artists  # fetches your top five artists
$ spotifetch top-tracks   # fetches your top five songs
```


#### The top artists and tracks depends on the time-frame. By default, SpotiFetch fetches your top artists in the short term, but mid term, and long term are also available using the `--term`/`-t` option.

```sh
$ spotifetch top-artists -t short # fetches top artists in the short term
$ spotifetch top-artists -t mid   # fetches top artists in the mid term
$ spotifetch top-artists -t long  # fetches top artists in the long term
```

> The `--term`/`-t` option is available for all three of the commands 


#### SpotiFetch supports `--no-random`/`-n` option to print the spotify ascii art with a green outline instead of a using a random color from the colorscheme

```sh
$ spotifetch profile      # prints spotify art with random color
$ spotifetch profile -n   # prints green spotify art
```

> The `--random`/`-r` option is also available for all three of the commands


#### The `--all-artists`/`-a` option can be used to display all artists on a track instead of just displaying one

```sh
$ spotifetch profile                 # Displays only one artist for a track 
$ spotifetch profile --all-artists   # Displays all artists for a track
```

> The `--all-artists`/`-a` option is available for the `profile` and `top-tracks` commands


#### SpotiFetch can be used with a variety of different color schemes.

> SpotiFetch uses [catppuccin](https://github.com/catppuccin) as it's default color scheme, but a different one can be specified using the `--color`/`-c` option. 

For example:
```sh
$ spotifetch profile         # uses catppuccin
$ spotifetch profile -c nord # uses nord 
```

> The `--color`/`-c` option is available for all three of the commands

Supported color schemes as of now: 
- [catppuccin](https://github.com/catppuccin) - latte, frappe, macchiato, mocha
- [nord](https://github.com/arcticicestudio/nord)
- [dracula](https://github.com/dracula/dracula-theme)
- [gruvbox](https://github.com/morhetz/gruvbox)
- [onedark](https://github.com/joshdick/onedark.vim)
- [tokyonight](https://github.com/folke/tokyonight.nvim)
- [ayu](https://github.com/ayu-theme)
- [palenight](https://github.com/drewtempelmeyer/palenight.vim)
- [gogh](https://github.com/Mayccoll/Gogh)


#### If you're a pywal user, the `--pywal` option can be used to match the SpotiFetch color scheme with the one generated by pywal

```sh
$ spotifetch profile --pywal   # Uses color scheme generated by pywal
```

> The `--pywal` option is available for all three of the commands

> NOTE: In order to use the `--pywal` option, the `colors.json` file must be present in `$HOME/.cache/wal/` (`colors.json` is generated automatically when pywal is used)


#### SpotiFetch also supports dynamically generated colorschemes using the `--art` option

```sh
$ spotifetch profile --art      # Generates colorscheme based on the cover art of the recently played song
$ spotifetch top-artists --art  # Generates colorscheme based on the profile image of the top artist
$ spotifetch top-tracks --art   # Generates colorscheme based on the cover art of the top track 
```

> If SpotiFetch can't generate a colorscheme for any reason, it will fallback to the colorscheme passed in as an option, or the default colorscheme of catppuccin 

---

### ❖ About SpotiFetch

SpotiFetch is the direct result of browsing too many unix subreddits and general interest in cli tools. The ascii art for spotify is a WIP and contributions to the logo are welcomed and encouraged! 

---

### ❖ What's New? 
0.4.4 - Dependency updates

---

<div align="center">

   <img src="https://img.shields.io/static/v1.svg?label=License&message=MIT&color=F5E0DC&labelColor=302D41&style=for-the-badge">

</div>