modules

geometor.etc

Tools for processing the Encyclopedia of Triangle Centers (ETC).

Key Components:

Usage:

Use the main function in __main__.py or the individual modules to process ETC data.

Submodules

Functions

ingest_folder(→ None)

Ingest all HTML files in the input folder by splitting them.

parse_center(→ dict | None)

Parse a center's HTML content into a structured dictionary.

generate_rst_files(→ None)

Generate RST files for a list of centers.

extract_glossary_terms(→ dict[str, str])

Extract glossary terms and definitions from the HTML content.

generate_glossary_rst(→ str)

Generate the content for glossary.rst.

Package Contents

geometor.etc.ingest_folder(input_folder: str, output_folder: str) None

Ingest all HTML files in the input folder by splitting them.

Parameters:
  • input_folder (str) – The directory containing input HTML files.

  • output_folder (str) – The directory to save the split files.

geometor.etc.parse_center(html_content: str) dict | None

Parse a center’s HTML content into a structured dictionary.

Parameters:

html_content (str) – The HTML content of the center definition.

Returns:

A dictionary containing center data (key, title, coordinates, notes), or None if parsing fails.

Return type:

dict

geometor.etc.generate_rst_files(centers: list[dict], output_dir: str, glossary_terms: list[str] | None = None) None

Generate RST files for a list of centers.

Parameters:
  • centers (list) – List of center data dictionaries.

  • output_dir (str) – Directory to save the generated RST files.

  • glossary_terms (list, optional) – List of glossary terms to link.

geometor.etc.extract_glossary_terms(html_content: str) dict[str, str]

Extract glossary terms and definitions from the HTML content.

Parameters:

html_content (str) – The HTML content of the glossary page.

Returns:

A dictionary mapping terms to their definitions (in RST format).

Return type:

dict

geometor.etc.generate_glossary_rst(terms: dict[str, str]) str

Generate the content for glossary.rst.

Parameters:

terms (dict) – A dictionary of terms and definitions.

Returns:

The generated RST content.

Return type:

str