vardb package

The vardb package contains utilities for loading and querying data in vardb. The contents of this package are used in other scripts and apis to build complex functionality.

Subpackages

Submodules

vardb.tools module

Some helper functions. Currently the only one that is frequently used is the initialize_logger function.

class vardb.tools.StreamToLogger(logger, log_level=20)

Bases: object

Fake file-like stream object that redirects writes to a logger instance.

write(buf)
vardb.tools.get_login_from_file(filename)

Gets account info from ~/filename (.ginaccount for bioapps, .pgpass for vardb, .limsaccount for lims)

Returns:a string with username:password
vardb.tools.get_md5sum(path)

Gets md5sum for file

Returns:md5sum for the file
vardb.tools.initialize_logger(filename=None, logLevel='info', logLevel_streaming='warning')

Initializes a logger with the indicated filename. Also, sends stderr to the logger as well.

Parameters:filename
vardb.tools.line_count(filename)

Just calculates the line count of a file

Parameters:filename
Returns:line count of file with filename
vardb.tools.production_error_handling(log_name)

This outer function handles passing the log name to the decorator.

Parameters:log_name – Name of the logger to use.