Online Storage using DropBox
Sometimes it becomes annoying to store files locally and you want your devices to synchronize so that they can share information among them. Lets say you got an app that has a tasklist which works in your cellphone, your desktop PC and your wristwatch. It would be desirable that when you add an item to your task list it automatically becomes available in all your devices instead of having to add it individually on each one.
For this we got several options, here I'll start with the simplest which is creating a file in Dropbox.
For this we got several options, here I'll start with the simplest which is creating a file in Dropbox.
Install Dropbox API
First of all clone the directory in your programs folder.
$ git clone https://github.com/dropbox/dropbox-sdk-python.git
Next enter the directory
$ cd dropbox-sdk-python
And build the project with python
$ sudo python3.5 setup.py install
$ git clone https://github.com/dropbox/dropbox-sdk-python.git
Next enter the directory
$ cd dropbox-sdk-python
And build the project with python
$ sudo python3.5 setup.py install
Next test that your library got correctly installed.
$ python3.5
$ import dropbox
It should output the console with no error message.
I got an error due to the packages that marked packages.urllib3.poolmanager as not existant in PoolManager so I had to edit the file <DROPBOX_LIB_DIRECTORY>/dropbox-sdk-python/dropbox/session.py
and change the line from requests.packages.urllib3.poolmanager import PoolManager
to from urllib3.poolmanager import PoolManager
$ python3.5
$ import dropbox
It should output the console with no error message.
I got an error due to the packages that marked packages.urllib3.poolmanager as not existant in PoolManager so I had to edit the file <DROPBOX_LIB_DIRECTORY>/dropbox-sdk-python/dropbox/session.py
and change the line from requests.packages.urllib3.poolmanager import PoolManager
to from urllib3.poolmanager import PoolManager
Register App
Next go to the dropbox developers page and select MyApps to create a new app.
For your app you're gonna need an access token which is a string of alphanumeric characters generated to identify your app in dropbox.
Next lets try a quick example:
https://github.com/dropbox/dropbox-sdk-python/blob/master/example/back-up-and-restore/backup-and-restore-example.py
https://github.com/dropbox/dropbox-sdk-python/blob/master/example/back-up-and-restore/backup-and-restore-example.py
Online Storage using Google Drive API
[1] http://wescpy.blogspot.mx/2014/09/simple-google-api-access-from-python.html
[2] https://developers.google.com/drive/v3/web/quickstart/python
[2] https://developers.google.com/drive/v3/web/quickstart/python