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:
  • driver (Path | None)

  • output (Path | None)

  • overwrite (bool)

  • use_multiprocess (bool)

  • log_level (Literal['ERROR', 'WARNING', 'INFO', 'DEBUG', 'TRACE'])

driver: Path | None = None#
output: Path | None = None#
overwrite: bool = False#
use_multiprocess: bool = False#
log_level: Literal['ERROR', 'WARNING', 'INFO', 'DEBUG', 'TRACE'] = 'INFO'#
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 REDEFINES overlay items in the layout table.

omit_filler

Hide FILLER items from the layout table.

log_level

Loguru logging verbosity.

Parameters:
  • copybook (Path)

  • include_redefines (bool)

  • omit_filler (bool)

  • log_level (Literal['ERROR', 'WARNING', 'INFO', 'DEBUG', 'TRACE'])

copybook: Path#
include_redefines: bool = False#
omit_filler: bool = False#
log_level: Literal['ERROR', 'WARNING', 'INFO', 'DEBUG', 'TRACE'] = 'WARNING'#
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 DISPLAY fields (e.g. cp500, cp037, ascii).

float_format

Floating-point representation for COMP-1/COMP-2 (ieee or ibm).

byteorder

Byte order for binary fields (big or little).

include_redefines

Include REDEFINES overlay columns in the output.

include_filler

Include FILLER columns in the output.

nrows

Maximum rows to preview on stdout when output is omitted.

log_level

Loguru logging verbosity.

Parameters:
  • copybook (Path)

  • datafile (Path)

  • output (Path | None)

  • encoding (str | None)

  • float_format (Literal['ieee', 'ibm'])

  • byteorder (Literal['big', 'little'])

  • include_redefines (bool)

  • include_filler (bool)

  • nrows (int)

  • log_level (Literal['ERROR', 'WARNING', 'INFO', 'DEBUG', 'TRACE'])

copybook: Path#
datafile: Path#
output: Path | None = None#
encoding: str | None = None#
float_format: Literal['ieee', 'ibm'] = 'ieee'#
byteorder: Literal['big', 'little'] = 'big'#
include_redefines: bool = False#
include_filler: bool = False#
nrows: int = 10#
log_level: Literal['ERROR', 'WARNING', 'INFO', 'DEBUG', 'TRACE'] = 'WARNING'#

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 (0 if all checks pass, 1 otherwise).

Parameters:

settings (DataSpectorSettings)

Return type:

int

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 inspect subcommand.

Returns:
int

Exit status code (0 on success, 1 if the copybook is missing).

Parameters:

settings (CobollerInspectSettings)

Return type:

int

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 convert subcommand.

Returns:
int

Exit status code (0 on success, 1 if an input file is missing).

Parameters:

settings (CobollerConvertSettings)

Return type:

int

dataspector.cli.main(argv=None)[source]#

Entry point for the dataspector CLI.

Parameters:
argv

Optional argument list (defaults to sys.argv[1:]).

Returns:
int

Exit status code (0 if all checks pass, 1 otherwise).

Parameters:

argv (Sequence[str] | None)

Return type:

int

dataspector.cli.coboller_main(argv=None)[source]#

Entry point for the coboller CLI (inspect and convert subcommands).

Parameters:
argv

Optional argument list (defaults to sys.argv[1:]).

Returns:
int

Exit status code (0 on success, 1 on error).

Parameters:

argv (Sequence[str] | None)

Return type:

int