for root, dirs, files in os.walk(local_directory):
    for filename in files:
        local_path = os.path.join(root, filename)
relative_path = os.path.relpath(local_path, local_directory)
Как загрузить полную папку в Dropbox с помощью python