# dbprocessing

# 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')

  Create a secure temp directory

  Returns
    `str`

      Path to resulting directory.

  Other Parameters
    suffix `str`, default `_dbprocessing`

      Suffix to include on the directory name

dbprocessing.runMe.rm_tempdir(tempdir)

  Remove the temp directory

  Parameters
    :class:`str`

      Path to directory to remove.

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

  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_list `list` of `runMe`

      List of runMe objects that need to be run.

    dbu `DButils`

      Open database connection.

    MAX_PROC `int`, default 2

      Maximum number of processes to run at once.

    rundir `str`, optional

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

  Returns
    :class:`tuple` of class:int

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

exception dbprocessing.runMe.ProcessException

  Class for errors in running processes

Release: 0.1.0 Doc generation date: Feb 10, 2022