diff options
author | Josias <me@josias.dev> | 2021-07-22 18:51:49 -0700 |
---|---|---|
committer | Josias <me@josias.dev> | 2021-07-22 18:51:49 -0700 |
commit | cc19c182acf119dd6a5a234533aee7b196851773 (patch) | |
tree | c16d86b88efa2c19a70c02f73e8c4ad8538c1599 | |
parent | 25d5f852d28b2510127d5c9b79f377ed3aeeaac3 (diff) |
Fix docstrings
-rwxr-xr-x | ugcli.py | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1,5 +1,5 @@ """ -ug-cli is an unofficial tool for accessing Ultimate Guitar and converting songs into more readable formats +ugcli is an unofficial tool for accessing Ultimate Guitar and converting songs into more readable formats """ import json @@ -11,19 +11,19 @@ try: except ImportError: from bs4 import BeautifulSoup -""" -Parses the Ultimate Guitar song webpage and extracts the song text -""" def extract_song(text): + """ + Parses the Ultimate Guitar song webpage and extracts the song text + """ soup = BeautifulSoup(text, "lxml") element = soup.find_all("div", {"class": "js-store"})[0] data = json.loads(element.get("data-content")) return data["store"]["page"]["data"]["tab_view"]["wiki_tab"]["content"] -""" -Parses Ultimate Guitar's song format into plaintext by removing excess syntax -""" def parse_song(text): + """ + Parses Ultimate Guitar's song format into plaintext by removing excess syntax + """ n = text n = n.replace("[tab]", "") n = n.replace("[/tab]", "") |