CLI & Settings (dataspector.cli, dataspector.settings)#
Settings Dataclasses#
Dataclass configuration models for the dataspector and coboller CLIs.
Parsed automatically by jsonargparse, supporting both command-line flags
and YAML/JSON configuration files (--config).
- class dataspector.settings.DataSpectorSettings(driver=None, output=None, overwrite=False, use_multiprocess=False, log_level='INFO')[source]#
Configuration for running integrity checks via an Excel driver workbook.
- Attributes:
- driver
Path to the Excel driver workbook defining locations and checks.
- output
Optional path to write a formatted Excel results report.
- overwrite
Overwrite output if it exists instead of appending a version suffix.
- use_multiprocess
Execute location checks in parallel across worker processes.
- log_level
Loguru logging verbosity (
ERROR,WARNING,INFO,DEBUG,TRACE).
- Parameters:
- class dataspector.settings.CobollerInspectSettings(copybook, include_redefines=False, omit_filler=False, log_level='WARNING')[source]#
Configuration for
coboller inspect.- Attributes:
- copybook
Path to the COBOL copybook file (
.cbl/.cpy).- include_redefines
Include
REDEFINESoverlay items in the layout table.- omit_filler
Hide
FILLERitems from the layout table.- log_level
Loguru logging verbosity.
- Parameters:
- class dataspector.settings.CobollerConvertSettings(copybook, datafile, output=None, encoding=None, float_format='ieee', byteorder='big', include_redefines=False, include_filler=False, nrows=10, log_level='WARNING')[source]#
Configuration for
coboller convert.- Attributes:
- copybook
Path to the COBOL copybook file (
.cbl/.cpy).- datafile
Path to the raw fixed-width or binary COBOL data file.
- output
Destination file path (
.csv,.tsv,.jsonl,.json,.xlsx,.parquet). Omit to preview rows on stdout.- encoding
Character encoding for
DISPLAYfields (e.g.cp500,cp037,ascii).- float_format
Floating-point representation for
COMP-1/COMP-2(ieeeoribm).- byteorder
Byte order for binary fields (
bigorlittle).- include_redefines
Include
REDEFINESoverlay columns in the output.- include_filler
Include
FILLERcolumns in the output.- nrows
Maximum rows to preview on stdout when output is omitted.
- log_level
Loguru logging verbosity.
- Parameters:
Command-Line Entry Points#
Command-line interfaces for dataspector and coboller powered by jsonargparse.
- dataspector.cli.run_dataspector(settings)[source]#
Execute the DataSpector batch check workflow from settings.
- Parameters:
- settings
Parsed CLI / config settings.
- Returns:
- int
Exit status code (
0if all checks pass,1otherwise).
- Parameters:
settings (DataSpectorSettings)
- Return type:
- dataspector.cli.run_coboller_inspect(settings)[source]#
Print a copybook’s field layout, PIC/USAGE types, and byte offsets.
- Parameters:
- settings
Parsed CLI settings for the
coboller inspectsubcommand.
- Returns:
- int
Exit status code (
0on success,1if the copybook is missing).
- Parameters:
settings (CobollerInspectSettings)
- Return type:
- dataspector.cli.run_coboller_convert(settings)[source]#
Preview or convert a COBOL data file into a human-readable format.
- Parameters:
- settings
Parsed CLI settings for the
coboller convertsubcommand.
- Returns:
- int
Exit status code (
0on success,1if an input file is missing).
- Parameters:
settings (CobollerConvertSettings)
- Return type: