parser.py
def data_getter(dir_url):
    """Iterator for corvid data, returns (<csv_data>, <year month day: str>"""
    # not saving files for now
    # Path(DATA_DIR).mkdir(exist_ok=True)
    # for x in Path(DATA_DIR).iterdir():
    #     x.unlink()

    r = requests.get(dir_url)
    r.raise_for_status()
    files = r.json()
    for file in files:
        if file.get('type') != "file":
            continue
        if file.get('name') in [".gitignore", "README.md"]:
            continue
        dl_url = file.get('download_url')
        if dl_url:
            # name example: 02-04-2020.csv
            month, day, year = file.get("name").split('.')[0].split('-')
            date = f"{year}{month}{day}"
            # TODO: consider dropping date yield and trusting "Last Update" as true across file
            yield io.StringIO(requests.get(dl_url).content.decode('utf-8-sig')), date
Iterator for corvid data, returns (<csv_data>, <year month day: str>
Iterator for corvid data, returns (, 
Iterator for corvid data returns (
def data_getter(dir_url):
    r = requests.get(dir_url)
    r.raise_for_status()
    files = r.json()
    for file in files:
        if file.get('type') != "file":
            continue
        if file.get('name') in [".gitignore", "README.md"]:
            continue
        dl_url = file.get('download_url')
        if dl_url:
            month, day, year = file.get("name").split('.')[0].split('-')
            date = f"{year}{month}{day}"
            yield io.StringIO(requests.get(dl_url).content.decode('utf-8-sig')), date
def data_getter ( dir_url ) : r = requests . get ( dir_url ) r . raise_for_status ( ) files = r . json ( ) for file in files : if file . get ( 'type' ) != "file" : continue if file . get ( 'name' ) in [ ".gitignore" , "README.md" ] : continue dl_url = file . get ( 'download_url' ) if dl_url : month , day , year = file . get ( "name" ) . split ( '.' ) [ 0 ] . split ( '-' ) date = f"{year}{month}{day}" yield io . StringIO ( requests . get ( dl_url ) . content . decode ( 'utf-8-sig' ) ) , date
Iterator for corvid data, returns (<csv_data>, <year month day: str>
Iterator for corvid data returns ( <csv_data > <year month day : str >
"""Iterator for corvid data, returns (<csv_data>, <year month day: str>""" # not saving files for now # Path(DATA_DIR).mkdir(exist_ok=True) # for x in Path(DATA_DIR).iterdir(): #     x.unlink() # name example: 02-04-2020.csv # TODO: consider dropping date yield and trusting "Last Update" as true across file
dir_url