Element

The goal is to help you avoid mistakes by not typing anything. It supports all 118 elements in the periodic table.

[1]:
from bobleesj.utils.data.element import Element
from bobleesj.utils.data.element import Element as E
[2]:
# Get the symbol of the element
E.H.symbol
[2]:
'H'
[3]:
# Get the full name of the element
E.H.full_name
[3]:
'Hydrogen'
[4]:
# Feel free to create helper functions to make you type
def get_element_info(element: Element) -> tuple[str, str]:
    """Parse the symbol and full name of the element."""
    return element.symbol, element.full_name
[5]:
symbol, full_name = get_element_info(E.P)
print(f"Symbol: {symbol}, Full Name: {full_name}")
Symbol: P, Full Name: Phosphorus