Your workflow is unique đšâđ» - tell us how you use Dropbox here.
Forum Discussion
Sadsyndrome
3 years agoExplorer | Level 3
Python Dropbox API slow performance
Hello
Im not a professional programmer..I recently built an app on python running on raspberry pi for monitoring energy usage at home.
it all works fine, I was using Dropbox app to save photo ima...
Greg-DB
Dropbox Community Moderator
3 years agoThe access token/refresh token shouldn't have any impact on that. The Dropbox API does have a rate limiting system, but it works by responding with a rate limit error response to any call it needs to reject, not by slowing down the connection speed.
Your connection speed to Dropbox depends on the routing you get between your ISP and our servers, and may be slower than your ISP's rated speeds. Sometimes resetting or retrying your connection gets you a different route and better speeds, but that is outside of our control. Some ISPs also throttle sustained connections so if you see an initial high connection speed followed by lower speeds, that could be the reason. Otherwise, there may be other local factors impacting the processing speed of your code, as well as the speed of your network connection. We can't offer help with your device or network connection though, so you may need to contact your computer and/or network admin, if any, for help with that.
To debug this you may want to step through with a debugger, and/or add more logging. If you do find an issue with a specific Dropbox API call, feel free to show the details here so we can take a look. (Be sure to redact any access token, refresh token, or app secret though.)
Sadsyndrome
3 years agoExplorer | Level 3
Thx. I donât think itâs a network error. Iâm transferring data to google sheets with no issue. The upload file process takes 3.5 mins for a single text file 201 bytes. The time does seem to be pretty consistent at approx 3.5 mins regardless of file size. It worked perfectly yesterday. Even getting file metadata takes over 2mins? Is there anywhere I can look at the Dropbox end ? I donât have an IDE I just use a text editor to knock up my python scripts and not sure where to start with debugging to be honest. I guess I could take a look at network monitor if I remember how! Iâve been out of the IT game for 4 years now and memory is fading:)
here is script and output. Sorry couldnât see how to attach these so I put them in this message. It works (slowly) so I assume keys and python syntax ok
##
import dropbox
from datetime import datetime
mylocpath ='/home/mark/FTP/myfiles/'
locfname='gasmeter.txt'
dboxpath='/meterreadings/'
file_from = mylocpath +locfname
file_to = dboxpath+locfname
dbx = dropbox.Dropbox(
app_key = "mykey",
app_secret = "mysecret",
oauth2_refresh_token = "myrefreshtokeen"
)
f = open(file_from, 'rb')
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
print ("start dbx call Time =", current_time)
dbx.files_upload(f.read(), file_to)
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
print ("end dbx call =", current_time)
print ("done")
##
mark@raspberrypi:~/pwrlog/test $ python dbupl.py
start dbx call Time = 20:10:10
end dbx call = 20:13:32
done
mark@raspberrypi:~/pwrlog/test $
e = 19:25:12
done
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!