Metadata-Version: 2.1
Name: spotifynews
Version: 0.1.2
Summary: Spotify news
Home-page: https://github.com/mpzaborski/spotifynews
Author: Mateusz Zaborski
Author-email: mpzaborski@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: atomicwrites (>=1.4.0)
Requires-Dist: attrs (>=20.3.0)
Requires-Dist: certifi (>=2020.12.0chardet>=4.0.0)
Requires-Dist: colorama (>=0.4.0idna>=2.10)
Requires-Dist: iniconfig (>=1.1.0)
Requires-Dist: packaging (>=20.9)
Requires-Dist: pluggy (>=0.13.0)
Requires-Dist: py (>=1.10.0)
Requires-Dist: pyparsing (>=2.4.7)
Requires-Dist: requests (>=2.25.0)
Requires-Dist: six (>=1.15.0)
Requires-Dist: spotipy (>=2.17.1)
Requires-Dist: toml (>=0.10.0)
Requires-Dist: urllib3 (>=1.26.0)

# spotifynews

<p float="left">
  <img src="https://github.com/mpzaborski/spotifynews/blob/master/docs/images/news.jpg" width="400" />
  <img src="https://github.com/mpzaborski/spotifynews/blob/master/docs/images/collections.jpg" width="400" />
</p>

##### Python library for creating news and collections

![workflow name](https://github.com/mpzaborski/spotifynews/workflows/Python%20package/badge.svg)

## Description

[Spotifynews](https://github.com/mpzaborski/spotifynews) is a wrapper on [spotipy](https://github.com/plamere/spotipy)
that provides new more complex functionalities: [news](#news-anchor) and [collections](#collections-anchor). It also
extends spotipy with additional functions that aim to simplify spotipy usage.

## Installation

```bash
pip install spotifynews
```

or upgrade

```bash
pip install spotifynews --upgrade
```

## Quick Start

To get started, install spotifynews and create an app on https://developers.spotify.com/.
Add your new SPOTIPY_CLIENT_ID and SPOTIPY_CLIENT_SECRET to your environment.
After script run for the first time authorize on spotify webpage by logging and allowing scope playlist-modify-public.

### <a name="news-anchor"></a>News

This functionality accumulates song from source playlist in local database and based on that it is able to notice truly
new tracks, because new trucks are not yet in database. If this situation occurs, it creates clone of original playlist
with only new tracks.

To utilize this functionality run script once a week and enjoy new hits from your favorite playlist :coffee:

```python
from spotifynews.update import news
todays_top_hits_id = 'spotify:playlist:37i9dQZF1DXcBWIGoYBM5M'
news(database_f="test.db", original_playlist_id=todays_top_hits_id)
```

### <a name="collections-anchor">Collections

This functionality creates playlist from all songs stored from source playlist in local database (songs which were
stored after 'news' function call). If you follow a playlist with 50 songs, which rotates 3 new songs per week, after
a year your clone playlist collection will have 86 tracks.

```python
from spotifynews.update import collections
todays_top_hits_id = 'spotify:playlist:37i9dQZF1DXcBWIGoYBM5M'
collections(database_f="test.db", original_playlist_id=todays_top_hits_id)
```


