0

I have an excel file where data is refreshing from third party application.

Problem to solve: My DJANGO web application should monitor that excel file continuously and detect a change from that excel file. Whenever there is a change then particular location of web page should be refreshed.

Could somebody please give suggestions to achieve this functionality?

1 Answers1

0

Basically, you need to check with a runtime process (e.g a cron) if the previously version of your file is different to the new version calling your runtime process. This means that you could read the content of the CSV file (could be with import csv or using pandas ìmport pandas as pd) and store it in some place (e.g another temporal file), then (according the time of you define to execute your cron) the content will be check again, and compare it against the content of what you previously have stored. If this happens, you could use Ajax to refresh your website section or use a real time library to refresh automatically, and store the new csv content again.

Manuel Carrero
  • 599
  • 1
  • 9
  • 29
  • But I do not want to compare two files (previous version and current version). I want to monitor single file continuously and trigger refresh if there is any change in particular cell. – gireesh kumar raju Muddaluru May 30 '19 at 03:44
  • As this [question](https://stackoverflow.com/questions/182197/how-do-i-watch-a-file-for-changes), you could use [watchdog](https://pythonhosted.org/watchdog/): "Python API library and shell utilities to monitor file system events" – Manuel Carrero May 30 '19 at 04:06
  • Thanks for good reference. Is there any way/library to watch/monitor content of the excel file (cell or column or row)? – gireesh kumar raju Muddaluru May 30 '19 at 05:55