Skip to content

Commit

Permalink
Doc string for load tsv file utils function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fjodor van Rijsselberg authored and Fjodor van Rijsselberg committed Jul 26, 2023
1 parent 45a225c commit d84a0b7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ async def sem_coro(coro):


def load_tsv_from_github_raw(url):
""" Loads a table from a tsv file fetched using a GitHub raw url.
TODO: Right now the first column of the tsv file is empty.
The code reflects this, but to be used universally the table
and this code should be fixed to expect a first column.
:param url: The GitHub raw url.
:return: a dict with the dsc title as key and frequency of use as value.
"""
response = requests.get(url)
lines = response.text.strip().split('\n')
reader = csv.reader(lines, delimiter='\t')
Expand Down

0 comments on commit d84a0b7

Please sign in to comment.