I have created a modified version of dropboxlogin.py that generates short-lived access tokens. So far, it seems to work with dropbox version 6.4.0 that is provided with Pythonista.
First run will authorize your application and store a long-lived refresh token in your device keychain.
# simple test app
import dropboxlogin
dropbox_client = dropboxlogin.get_client()
print('Getting account info...')
account_info = dropbox_client.users_get_current_account()
print('linked account:', account_info)
Useful links:
Migrating App access tokens
Dropbox OAuth Guide
I was able to update dropbox to the latest version with this work around script which downloads the dropbox wheel and unzips the contents in site-packages. I had to use Stash pip to install the requests, six and stone. I'm still testing to see if it is better to stick with the original Pythonista dropbox version or to use the upgraded versions of dropbox, requests and six.
# workaround to install latest dropbox in pythonista
# install requirements using stash pip
# pip install requests
# pip install six
# pip install stone
import sys, os
import requests
from zipfile import ZipFile
sitepath = os.path.expanduser('~/Documents/site-packages-3')
os.chdir(sitepath)
from zipfile import ZipFile
url = 'https://files.pythonhosted.org/packages/ef/64'
url += '/2ef3c03ac039f9e5f29c0f557dc3f276241ef3c1627903a5f6a8c289cf24/'
url += 'dropbox-11.7.0-py3-none-any.whl'
dest_path = './dropbox.zip'
r = requests.get(url)
with open(dest_path, 'wb') as f:
f.write(r.content)
print('download complete...')
with ZipFile(dest_path, 'r') as zip:
# extracting all the files
print('Extracting all the files now...')
zip.extractall()
print('Done!')
os.remove(dest_path)