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.

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 (Union[str, Path, TextIO, None]) – Filepath or handle to dump output to.

  • out_format (Literal['json', 'pprint', 'print', 'ruamel', 'yaml']) – 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 (Optional[Callable[[TextIO], list[dict[str, Any]]]]) – Castep parser to use. If None will be determined from extension.

  • out_format (Literal['json', 'pprint', 'print', 'ruamel', 'yaml']) – Format to dump as.

  • loglevel (int) – Logging level.

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

Returns:

Parsed data.

Return type:

dict

Raises: