-
Notifications
You must be signed in to change notification settings - Fork 0
Dropbox Sync
Fran Romero edited this page Feb 20, 2019
·
13 revisions
First you have to visit this page(login is required) select Dropbox API, Full Dropbox and a name.
Before you can run it, you have to install Dropbox library. I recommend you use a virtualenv to manage dependencies:
$ pip install dropboxAnd then copy
from dropbox import Dropbox, files
ACCESS_TOKEN = 'DROPBOX ACCESS TOKEN'
CSV_FILE = "PATH TO CSV FILE"
DROPBOX_PATH = "DROPBOX FOLDER/FILENAME"
def main():
dpx = Dropbox(ACCESS_TOKEN)
#/home/pi/ir_profile_tracker/output/drivers.csv
with open(CSV_FILE, 'rb') as file:
dpx.files_upload(file.read(),DROPBOX_PATH , mode=files.WriteMode.overwrite)
if __name__ == "__main__":
main()