Add ExcelConverter module and demo script for Excel data transformation

This commit is contained in:
Misaka_Company
2026-01-16 12:51:06 +08:00
parent f9651ccf07
commit 4d441be304
4 changed files with 330 additions and 213 deletions

23
convert_excel_demo.py Normal file
View File

@@ -0,0 +1,23 @@
"""
Excel 转换工具使用示例
"""
from utils.excel_converter import ExcelConverter
def main():
# 创建转换器verbose=True 打印详细日志)
converter = ExcelConverter(verbose=True)
# 转换 Excel 文件
input_file = "data/离散备料计划打印模版-布莱迪.xlsx"
output_file = "data/离散备料计划打印模版-布莱迪_转换.xlsx"
# 执行转换
df = converter.convert(input_file, output_file)
print(f"\n转换完成!")
print(f"数据形状: {df.shape}")
if __name__ == "__main__":
main()