Python module to synchronize files between Pythonista on an iOS device and Dropbox
There are other Python synchronization apps, but they all use the original Dropbox API V1, which is deprecated and soon to be discontinued. The Synchronator module was created using the new V2 API to synchronize Python scripts between iOS devices and to backup to Dropbox.
!! IMPORTANT !! - Synchronator is dependent on a number of 3rd party modules for proper operation. These are certifi, chardet, dropbox, idna, urllib3, and requests. I strongly recommend that they be installed in the above order since really it is requests that depends on the others and cannot work without them.
Synchronator is dependent on another module, called DropboxSetup, which saves and loads Dropbox access tokens for use by other Python modules.
For Synchronator to work properly it needs the latest version of the dropbox Python package, which I use Stash to install. The latest version of the dropbox package has support for both the original V1 API as well as the newer V2 API, which Synchronator needs to operate.
Once these pieces are all in place on your iOS device, you will need to configure Synchronator for it to work. The following steps can be used to do this.
- Go to the Dropbox developer web page.
- Create an app that uses the Dropbox API V2. (Not the Dropbox for Business API)
- Select the App Folder option.
- Enter a name for the app. I recommend
- If the previous steps were successful then you have created an app and should now be on the app page where you can edit the properties of the app.
- Find the property
Generated Access Tokenand select the Generate button.
- Select and copy the Access Token to the clipboard.
- Execute Synchronator in Pythonista on your iOS device.
- Enter the Access Token at the prompt. Paste it if you performed steps 1 thru 6 on the same iOS device that Pythonista is on.
If everything was successful then Synchronator will begin synchronizing with Dropbox.
As changes are made to Synchronator.py you will need to update to the latest version. There is a function in Synchronator.py (from version 1.5.1 on) named download that will get the code from GIT and save it to Pythonista. To do this, go to the console in Pythonista and type the following:
import Synchronator; Synchronator.download()
You should see the message 'Synchronator.py Downloaded Successfully'.
Be sure to check out the Wiki as well for additional info.