Using Python With Dropbox API

Using Python With Dropbox API

Aug 12, 2020

Using Python With Dropbox API is very easy and well documented. Dropbox is where the creator of Python Guido van Rossum spent the last few years of his working carrier so its not really that much of a surprise.

The first thing you will need to do is go to 

https://www.dropbox.com/developers/apps

Create a new app on the DBX Platform

Choose whatever API you want.

Bild I chose the regular Dropbox API

Next, choose the type of access you need One Folder or All of Dropbox.

Bild Then pick a name for your app and click Create App.

Once you are in the app go down to the Oauth area and click on Generate under Generated Access Token save that cause you will need it for all API requests.

Bild Now install dropbox module via pip.

pip install dropbox

or Install from source:

git clone git://github.com/dropbox/dropbox-sdk-python.git
cd dropbox-sdk-python
python setup.py install

To make sure its working just list the folders if there is a lot in the directory it can take a minute.

import dropbox
dbx = dropbox.Dropbox(“YOURACCESSTOKEN”)
dbx.usersgetcurrent_account()
for entry in dbx.fileslistfolder(”).entries: print(entry.name)

Gefällt dir dieser Beitrag?

Kaufe Brandon Lipani einen Kaffee

Mehr von Brandon Lipani