from bs4 import BeautifulSoup


def get_existing_toc(toc_path: str) -> BeautifulSoup:
	"""
	Returns a BeautifulSoup object representing the existing ToC file.

	INPUTS:
	toc_path: the path to the existing ToC file

	OUTPUTS:
	A BeautifulSoup object representing the current ToC file
	"""

	with open(toc_path, "r", encoding="utf-8") as file:
		return BeautifulSoup(file.read(), "html.parser")