Feat: search and download images
This commit is contained in:
23
main.py
23
main.py
@@ -1,4 +1,5 @@
|
||||
import csv
|
||||
import sys
|
||||
from enum import Enum
|
||||
from typing import List
|
||||
|
||||
@@ -12,13 +13,23 @@ class TableColumns(Enum):
|
||||
ALT_NAME = 3
|
||||
|
||||
|
||||
def main():
|
||||
anime_list: List[str] = []
|
||||
with open('./aboba.csv', 'r', newline='') as csvfile:
|
||||
def main(file: str):
|
||||
anime_list_before_group: List[str] = []
|
||||
with open(file, 'r', newline='') as csvfile:
|
||||
spamreader = csv.reader(csvfile, delimiter=',')
|
||||
for row in spamreader:
|
||||
name: str = row[TableColumns.JAP_NAME.value]
|
||||
for i, row in enumerate(spamreader):
|
||||
if i == 0:
|
||||
continue
|
||||
if row[TableColumns.JAP_NAME.value] != '':
|
||||
anime_list_before_group.append(
|
||||
row[TableColumns.JAP_NAME.value])
|
||||
# anime_list: List[str] = group_by_common_part(anime_list_before_group) # TODO: find the best algorithm for that
|
||||
print(anime_list_before_group)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
argv = sys.argv
|
||||
if len(argv) != 2:
|
||||
print('Error! Run program with file name: \'python main.py file.csv\'')
|
||||
sys.exit(1)
|
||||
sys.exit(main(argv[1]))
|
||||
|
||||
Reference in New Issue
Block a user