You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
from typing import List
|
|
|
|
|
|
|
|
|
|
from service.IFileService import IFileService
|
|
|
|
|
from entity.BilibiliVideo import BilibiliVideo
|
|
|
|
|
from tool import tttt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ExcelService(IFileService):
|
|
|
|
|
def __init__(self):
|
|
|
|
|
"""
|
|
|
|
|
此处增加对excel的高级参数(若有)
|
|
|
|
|
"""
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def save(self, filePath, videoList: List[BilibiliVideo]):
|
|
|
|
|
filePath += ".xlsx"
|
|
|
|
|
tttt.write_to_excel(videoList,filePath)
|
|
|
|
|
tttt.calculate_ratio_and_update(filePath, 'Sheet')
|
|
|
|
|
texts = [
|
|
|
|
|
"approve",
|
|
|
|
|
"money",
|
|
|
|
|
"practical",
|
|
|
|
|
"Stunning",
|
|
|
|
|
"interaction"
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
tttt.write_english_texts(filePath, 'Sheet', texts)
|
|
|
|
|
tttt.create_bar_chart(filePath,'Sheet')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print("Data analysis written to the Excel file.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|