funpack.main
This module contains the funpack entry point.
- funpack.main.configLogging(args)[source]
Configures
funpacklogging.- Parameters:
args –
argparse.Namespaceobject containing parsed command line arguments.
- funpack.main.doCleanAndProcess(dtable, args)[source]
Data cleaning and processing stage.
- Parameters:
dtable –
DataTablecontaining the dataargs –
argparse.Namespaceobject containing command line argumentspool –
multiprocessing.Poolobject for parallelisation (may beNone)
- funpack.main.doDescriptionExport(dtable, args)[source]
If a
--description_filehas been specified, a description for every column is saved out to the file.
- funpack.main.doExport(dtable, args)[source]
Data export stage.
- Parameters:
dtable –
DataTablecontaining the dataargs –
argparse.Namespaceobject containing command line arguments
- funpack.main.doICD10Export(args)[source]
If a
--icd10_map_filehas been specified, the ICD10 codes present in the data (and their converted values) are saved out to the file.
- funpack.main.doImport(args, mgr)[source]
Data import stage.
- Parameters:
args –
argparse.Namespaceobject containing command line argumentsmgr –
multiprocessing.Managerobject for parallelisation (may beNone)
- Returns:
A tuple containing:
- funpack.main.doSummaryExport(dtable, args)[source]
If a
--summary_filehas been specified, a summary of the cleaning steps that have been applied to each variable are saved out to the file.
- funpack.main.doUnknownsExport(dtable, args, unknowns, uncategorised)[source]
If the
--unknown_vars_fileargument was used, the unknown/ unprocessed columns are saved out to a file.- Parameters:
dtable –
DataTablecontaining the dataargs –
argparse.Namespaceobject containing command line argumentsunknowns – List of
Columnobjects representing the unknown columns.uncategorised – A sequence of
Columnobjects representing columns which are uncategorised, and have no processing or cleaning rules specified on them.
- funpack.main.generateDescription(dtable, col)[source]
Called by
doDescriptionExport(). Generates and returns a suitable description for the given column.- Parameters:
dtable –
Datatableinstancecol –
Columninstance
- funpack.main.splitDataTable(dtable, args)[source]
Splits the .:class:DataTable into separate numeric/non-numeric tables.
Called by
doExport(). If the--suppress_non_numericsand/or--write_non_numericsoptions are active, non-numeric columns need to be separated from numeric columns, and possibly saved to a separate output file.