castep_outputs.cli.castep_outputs_main

castep_outputs.cli.castep_outputs_main#

Main castep parser access routines.

Functions

main()

Run the main program from command line.

parse_all([output, out_format, loglevel, ...])

Parse all files in files dict.

parse_single(in_file[, parser, out_format, ...])

Parse a file using the given parser and post-process according to options.

run(args)

Runner for main program.

castep_outputs.cli.castep_outputs_main.main()[source]#

Run the main program from command line.

Return type:

None

castep_outputs.cli.castep_outputs_main.parse_all(output=None, out_format='json', *, loglevel=30, testing=False, **files)[source]#

Parse all files in files dict.

Parameters:
  • output (str | Path | TextIO | None) – Filepath or handle to dump output to.

  • out_format (OutFormats) – Format to dump as.

  • loglevel (int) – Logging level.

  • testing (bool) – Whether used for test suite (disable processing fragile properties).

  • **files (Sequence[Path]) – Dictionary of {parser needed: Sequence of paths to parse}.

Return type:

None

castep_outputs.cli.castep_outputs_main.parse_single(in_file, parser=None, out_format='print', *, loglevel=30, testing=False)[source]#

Parse a file using the given parser and post-process according to options.

Parameters:
  • in_file (str | Path | TextIO) – Input file to parse.

  • parser (Callable[[TextIO], list[dict[str, Any]]] | None) – Castep parser to use. If None will be determined from extension.

  • out_format (OutFormats) – Format to dump as.

  • loglevel (int) – Logging level.

  • testing (bool) – Whether used for test suite (disable processing fragile properties).

Returns:

Parsed data.

Raises:

ValueError – If invalid parser provided.

Return type:

list[dict]

castep_outputs.cli.castep_outputs_main.run(args)[source]#

Runner for main program.

Parameters:

args (argparse.Namespace) – Run arguments.

Return type:

None