sec_parser.utils ================ .. py:module:: sec_parser.utils .. autoapi-nested-parse:: The utils subpackage contains utility functions and helpers used across the sec_parser project. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/sec_parser/utils/bs4_/index /autoapi/sec_parser/utils/env_var_helpers/index /autoapi/sec_parser/utils/py_utils/index Exceptions ---------- .. autoapisummary:: sec_parser.utils.ValueNotSetError Functions --------- .. autoapisummary:: sec_parser.utils.is_unary_tree sec_parser.utils.get_value_or_env_var sec_parser.utils.get_direct_subclass_of_base_class Package Contents ---------------- .. py:function:: is_unary_tree(tag: bs4.Tag) -> bool `is_unary_tree` determines if a BeautifulSoup tag forms a unary tree. In a unary tree, each node has at most one child. Unary trees can contain NavigableString leaves. However, if a non-leaf node contains a non-empty NavigableString, the tree is not considered unary. Additionally, if the some tag is a 'table', the function will return True regardless of its children. This is because in the context of this application, 'table' tags are always considered unary. .. py:exception:: ValueNotSetError Bases: :py:obj:`ValueError` Inappropriate argument value (of correct type). .. py:function:: get_value_or_env_var(value: str | None, env_var: str, default: str | None = None, exc: type[Exception] = ValueNotSetError) -> str .. py:function:: get_direct_subclass_of_base_class(cls: type, base_class: type) -> type Given a class, find the class that is one step below the specified base_class in its inheritance hierarchy.