dbprocessing.runMe

Support for running codes to make data files, as defined in database.

Functions

mk_tempdir([suffix])

Create a secure temp directory

rm_tempdir(tempdir)

Remove the temp directory

runner(runme_list, dbu[, MAX_PROC, rundir])

Go through a list of runMe objects and run them

Classes

runMe(dbu, utc_file_date, process_id, ...[, ...])

class holds all the info it takes to run a process

Exceptions

ProcessException

Class for errors in running processes

dbprocessing.runMe.mk_tempdir(suffix='_dbprocessing')[source]

Create a secure temp directory

Returns
str

Path to resulting directory.

Other Parameters
suffixstr, default _dbprocessing

Suffix to include on the directory name

dbprocessing.runMe.rm_tempdir(tempdir)[source]

Remove the temp directory

Parameters
:class:`str`

Path to directory to remove.

dbprocessing.runMe.runner(runme_list, dbu, MAX_PROC=2, rundir=None)[source]

Go through a list of runMe objects and run them

Todo

This function can be made a smart as one wants, for now it is not made to be smart, but flexible

Parameters
runme_listlist of runMe

List of runMe objects that need to be run.

dbuDButils

Open database connection.

MAX_PROCint, default 2

Maximum number of processes to run at once.

rundirstr, optional

Directory to run in, default use a freshly-created temp directory.

Returns
:class:`tuple` ofclass:int

number of processes that successfully completed, number of processes that failed.

exception dbprocessing.runMe.ProcessException[source]

Class for errors in running processes


Release: 0.1.0 Doc generation date: Feb 10, 2022