forked from ckh08045/AutoPercenty
19 lines
508 B
Python
19 lines
508 B
Python
import pandas as pd
|
|
from pymongo import MongoClient
|
|
from logger_module import default_logger as logger
|
|
|
|
client = MongoClient('mongodb://root:1234@cckb9998.synology.me:27017/')
|
|
logger.debug("DB생성")
|
|
db = client['taobao_project']
|
|
collection = db['delv_fee']
|
|
|
|
# 엑셀 파일 읽기
|
|
excel_file = 'delv.xlsx'
|
|
df = pd.read_excel(excel_file)
|
|
|
|
# DataFrame을 MongoDB에 저장
|
|
records = df.to_dict(orient='records')
|
|
collection.insert_many(records)
|
|
|
|
logger.debug("데이터가 MongoDB에 저장되었습니다.")
|