This service handles the uploading and downloading of files to and from Dropbox. The service exposes 4 endpoints;
- POST '/download-job' This endpoint downloads all files located in a Dropbox folder called 'all' and saves them in the working directory in a folder also called 'all'. It returns the data on the newly created download job including a job-id which can be used to check on the completion status of the download job
- GET '/download-job/{job-id}' This endpoint returns data on the status of a download job
- POST '/upload-job' This endpoint takes a JSON object with an array of classes that were previously classified by the image classifier service. It then looks for folders corresponding to the classes then begins uploading them to Dropbox. It returns a JSON object which includes the ID of the upload job
- GET '/upload-job/{job-id}' This endpoint is used for checking on the status of an upload job
- Get a token by following the instructions here
- Set the token as an environment variable
- Test with pytest, after all tests pass you can start modifying for your own use
This service functions independently, but I built it to work in tandem with the classifier service available here. This downloader and the classifier can be combined and used as a cloud storage image classification system, such as this.