otld.utils.checks.FinancialDataChecker¶
- class otld.utils.checks.FinancialDataChecker(df: DataFrame, level: str, kind: str, action: str = 'error')¶
Bases:
GenericChecker
Implement validation checks for the financial data
- __init__(df: DataFrame, level: str, kind: str, action: str = 'error')¶
Initialize FinancialDataChecker
- Args:
df (pd.DataFrame): Financial data DataFrame level (str): Funding level (Federal, State, Total) kind (str): ACF Instructions (196, 196R, Appended) action (str, optional): Action to take when an assertion fails. Defaults to “error”, but also accepts “export”
Methods
__init__
(df, level, kind[, action])Initialize FinancialDataChecker
check
()Choose which check(s) to perform
export
(path[, sheet_name])Export checks to a workbook
Execute federal financial data checks
lines_to_names
(df)Rename line numbers to human readable names
Rename columns to 196R line numbers
Attributes
Action to be taken when an assertion fails
Financial data frame
ACF Instructions (196, 196R, Appended)
Funding level (State, Federal, Total)
- property action¶
Action to be taken when an assertion fails
- check()¶
Choose which check(s) to perform
- property df¶
Financial data frame
- export(path: str | PathLike, sheet_name: str = None, **kwargs) None ¶
Export checks to a workbook
- Args:
path (str | os.PathLike): Path to export checks to. sheet_name (str, optional): An optional sheet name for the checks. Defaults to None.
- federal_financial_data_checks()¶
Execute federal financial data checks
- property kind¶
ACF Instructions (196, 196R, Appended)
- property level¶
Funding level (State, Federal, Total)
- lines_to_names(df: DataFrame)¶
Rename line numbers to human readable names
- names_to_lines()¶
Rename columns to 196R line numbers