snowex_db.upload.batch module

snowex_db.upload.batch module#

Module for storing and managing multiple file submissions to the database

class snowex_db.upload.batch.BatchBase(session, filenames, n_files=-1, debug=False, **kwargs)[source]#

Bases: object

Base Class for uploading multiple files to the database. This class manages uploading, managing logging and timing, and reporting of errors

Attributes:

filenames: List of files to upload log: Logger object with colored logs installed. errors: List of tuple that contain filename, and exception thrown

during uploaded

uploaded: Integer of number of files that were successfully uploaded

Functions:
push: Wraps snowex_db.upload.UploadProfileData to submit data.

Use debug=False to allow exceptions

report: Log the final result of uploaded files, errors, time elapsed,

etc.

UploaderClass = None#
push()[source]#

Push all the data to the database while tracking errors. If the class is instantiated with debug=True exceptions will error out. Otherwise, any errors will be passed over and counted/reported

report(files_attempted)[source]#

Report timing and errors that occurred

Args:

files_attempted: Number of files attempted