mllf.file_handling.read_rtf

RTF file parser

Provides helpers to parse RTF files (example in examples/training_files) and extract ATOM lines. Each ATOM line is expected to have the format:

ATOM <name> <type> <charge>

We collect the atom types (third column) and sum the charges (last column).

Functions: - parse_rtf_file(path) -> dict with keys: site, sub, atom_types (list), total_charge (float) - parse_rtf_dir(directory) -> dict mapping “site{n}_sub{m}” -> parsed dict

Functions

parse_rtf_dir(directory)

Parse all .rtf/.rft files in a directory and return a mapping keyed by site_sub.

parse_rtf_file(path)

Parse a single RTF/PRES fragment file and return extracted info.