# -*- coding: utf-8 -*-
from setuptools import setup

package_dir = \
{'': 'src'}

packages = \
['pylyrics2']

package_data = \
{'': ['*']}

install_requires = \
['beautifulsoup4>=4.10.0,<5.0.0',
 'kaggle>=1.5.12,<2.0.0',
 'matplotlib>=3.5.1,<4.0.0',
 'pandas>=1.3.5,<2.0.0',
 'requests>=2.27.1,<3.0.0',
 'wordcloud>=1.8.1,<2.0.0']

setup_kwargs = {
    'name': 'pylyrics2',
    'version': '1.0.7',
    'description': 'This package helps you extract and analyse lyrics like a piece of cake!',
    'long_description': '# pylyrics2  \n[![ci-cd](https://github.com/UBC-MDS/pylyrics/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/UBC-MDS/pylyrics/actions/workflows/ci-cd.yml)\n[![Documentation Status](https://readthedocs.org/projects/pylyrics/badge/?version=latest)](https://pylyrics.readthedocs.io/en/latest/?badge=latest)\n[![codecov](https://codecov.io/gh/UBC-MDS/pylyrics/branch/master/graph/badge.svg?token=pjbS2ZPk2h)](https://codecov.io/gh/UBC-MDS/pylyrics) \n\n      \n\nA Python package to extract and analyze lyrics\n\n-   Authors: Abhiket Gaurav, Artan Zandian, Macy Chan, Manju Abhinandana Kumar\n\n<br>\n\n### Overview\nThis package allows users to extract and analyze lyrics effortlessly. With pylyrics2 users can download songs attribute datasets from Kaggle, extract lyrics and generate a word cloud. \n\n<br>\n\n### Functions\n---\n<br>\n\n| Function Name | Input | Output | Description |\n|-----------|------------|---------------|------------------|\n| download_data | `dataset`, `file_path`, `columns` | Pandas Dataframe | Downloads dataset from `kaggle dataset` and extract `columns` from csv file |\n| extract_lyrics | `song_title`, `artist` | String | Extracts song lyrics of a song `song_title` by `artist` |\n| clean_text | `text`, `bool_contra_dict` | String |  Cleans up the `lyrics` by removing special characters, html tags, #tags, contraction words and convert everything to lower case |\n| plot_cloud | `song`, `file_path`, `max_font_size`, `max_words`, `background_color` | Image | Creates a word cloud image of most occuring words of a song/songs by an artist |\n\n<br>\n\n### Our Package in the Python Ecosystem\n---\nThere exist similar packages Python. However, this package is more holistic, in the sense that it downloads the lyrics through APIs, cleans the text, and then makes the word cloud. There are packages which does one of these steps. This package takes care of all the steps. Of the many other similar packages, the following are examples that come close: [PyLyrics](https://pypi.org/project/PyLyrics/), [Cloud-Lyrics](https://github.com/lorenza12/Cloud-Lyrics) and [deezer.io](https://deezer.io/a-new-way-to-look-at-an-artist-from-lyrics-to-wordclouds-christmas-special-56a854cb4e77#.op1gx82h4)\n\n<br>\n\n### Installation\n---\n```bash\n$ pip install pylyrics2\n\n```\n<br>\n\n### Features\n---\nThe `pylyrics2` packages contains the following four functions:  \n\n1. `download_data()` The download data function downloads dataset from Kaggle, extracts the given columns from csv file and creates a dataframe.\n\n2. `extract_lyrics()` The extract lyrics function, extracts the lyrics from API for a song title and artist and saves it as a dataframe with columns song title, artist and lyrics.\n\n3. `clean_text()` The lyrics extracted from `extract_lyrics()` are not clean. It removes special characters, html tags, #tags, contraction words and convert everything to lower case to get a cleaned paragraph. \n\n4. `plot_cloud()` The plot cloud function creates a word cloud of most occurring words in a song/songs by an artist.\n\n<br>\n\n### Dependencies\n---\n- python = ^3.9\n- pandas = ^1.2.3\n- kaggle = ^1.5.12\n- wordcloud = ^1.8.1\n- matplotlib = ^3.5.1\n- beautifulsoup4 = ^4.10.0\n\n<br>\n\n### Usage\nThe `pylyrics2` package is a visual way to find prominent word used in a lyrics. Given a song title and artist\'s name, this package will show the word that is used most in that lyrics (or a group of lyrics)\n#### Downloading and Selecting\nThe first function in our package is the `download_data()`. Here you will input your `kaggle dataset` and the columns to be extracted into a Pandas DataFrame with `columns` argument. \n\nTo use the Kaggle API, sign up for a Kaggle account at [Kaggle](https:/www.kaggle.com). Then go to the \'Account\' tab of your user profile (https://www.kaggle.com/<username\\>/account) and select \'Create API Token\'. This will trigger the download of kaggle.json, a file containing your API credentials. Place this file in the location `~/.kaggle/kaggle.json`. The function will automatically read your Kaggle credentials from the above path.\n  \n```python \nfrom pylyrics2 import download_data as dd\n# Example dataset: Spotify Song Attributes  \ndataset = "geomack/spotifyclassification"\nfile_path = "data/spotify_attributes"\ncolumns = ["song_title", "artist"]\n# Extract columns \ndd.download_data(dataset, "data/spotify_attributes", ["song_title", "artist"])\n```\n#### Extracting Lyrics\nThe `extract_lyrics()` function gets the `song_title` and `artist` name, checks validity and avialability of the combination, and extracts the lyrics for that song in a raw string format with header, footer etc which needs to be cleaned in order to create a human-readable text.  \n\n```python \nfrom pylyrics2 import extract_lyrics as el\n# extracting lyrics \nraw_lyrics = el.extract_lyrics("22", "Taylor Swift")\n```\n#### Cleaning\nOur `clean_text()` function is straightforward. It turns the raw lyrics into a human-readable text.\n```python \nfrom pylyrics2 import clean_text as ct\n# Clean the extracted raw lyrics (text)\nclean_lyrics = ct.clean_text(raw_lyrics)\n```\n\n#### Creating WordCloud\nWordCloud is an artistic rendering of the most frequent words in a text document. A higher occurrence for a word is translated into a larger text size.  \nAt this stage, we have helper functions to facilitate the extraction and cleaning of lyrics. The `plot_cloud()` function accepts a **dictionary** with `artist` as dictionary key and `song_title` as values. It will then extract the lyrics for all songs in the dictionary and saves a WordCould of the most occurring terms in the `file_path` provided by the user. The WordClould parameters to be set are self-explanatory: `max_font_size`, `max_word` and `background_color`.\n```python \nfrom pylyrics2 import plot_cloud as pc\n# plotting and saving WordCloud\nsong = { "Taylor Swift": "all too well", "Adele" : "Hello" }\nfile_path = "data/wordcloud"\npc.plot_cloud(song, file_path, max_font_size=30, max_words=100, background_color=\'black\')\n```\n\n<br>\n\n### Documentation\n---\nThe official documentation is hosted on Read the Docs: [here](https://pylyrics.readthedocs.io/en/latest/)\n\n<br>\n\n## Contributors\n---\nThe names of core development team is listed below.\n\n|           Name          |   GitHub Handle   |\n|:-----------------------:|:-----------------:|\n|      Abhiket Gaurav     |      abhiket      |\n|      Artan Zandian      |     artanzand     |\n|        Macy Chan        |      macychan     |\n| Manju Abhinandana Kumar | manju-abhinandana |\n\nWe welcome and recognize all contributions. Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.\n\n### License\n\n`pylyrics2` was created by Group 2. It is licensed under the terms of the MIT license.\n\n### Credits\n\n`pylyrics2` was created with [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/) and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter).\n',
    'author': 'Group 2',
    'author_email': None,
    'maintainer': None,
    'maintainer_email': None,
    'url': None,
    'package_dir': package_dir,
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.9,<4.0',
}


setup(**setup_kwargs)
