Можно ли добиться двунаправленной синхронизации между Excel и MongoDB?Python

Программы на Python
Ответить Пред. темаСлед. тема
Гость
 Можно ли добиться двунаправленной синхронизации между Excel и MongoDB?

Сообщение Гость »


A friend of mine has a team of data collectors that collect data in excel, he needs it to be updated in his MongoDb database in real time, if that's complex, he wants it to be done in a single click.

I tried writing a program that checks the file and the DB to constantly update them, I'm a beginner when it comes to programming so it looked like this

import pandas as pd from motor import MotorClient client = MotorClient('localhost', 27017) db = client['Exceldb'] collection = db['excel'] #Excel read excel_file = "Employee.csv" df = pd.read_csv(excel_file) collection.drop() # Drop existing data if any collection.insert_many(df.to_dict('records')) data = list(collection.find()) df = pd.DataFrame(data) df.to_csv(excel_file, index=False) client.close() When I ran this, nothing happened.
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Python»