1

I have built a Dashboard using dash and plotly which is plotting data from the excel file located on my local PC. The data in the excel file will be updated on a daily basis but I don't know what should I do, so that the Dashboard gets updated as well without me redeploying it every day. Maybe you can give some advice or ideas? I am a newbie in Python, so maybe there is something pretty obvious but I haven't come across it yet..

P.S. The dashboard is currently deployed using Heroku.

mariant
  • 131
  • 10

1 Answers1

0

the best solution for you will be to use a cloud storage solution like AWS S3 or Google Cloud Storage. Here is a link to another Stack Overflow post on uploading to Google Cloud and an in-depth post on reading CSV from google cloud.

You will need to create a service on your local computer to upload your CSV file automatically, and a service on your dash app to query google cloud for the new CSV / pandas dataframe at given intervals.

One solution could be to use a scheduler to run the update check from your app in a new thread:

from datetime import datetime
from apscheduler.schedulers.background import BackgroundScheduler

def start():
    scheduler = BackgroundScheduler(timezone="Pacific/Auckland")
    scheduler.add_job(loadCSVData, 'cron', day_of_week='mon-fri', hour=10, minute=47)
    print("loadCSVData called - CSV data updated in app")
    scheduler.start()
Andrew H
  • 1
  • 1