Skip to content

PyHTools Package Documentation

Consists of documentation inside of pyhtools package

main

start()

Starts PyHtools UI

Returns:

Type Description

None

Source code in pyhtools\__main__.py
def start():
    '''Starts PyHtools UI

    Args:
        None

    Returns:
        None
    '''
    UI.banner()
    try:
        run(UI.run())
    except Exception as e:
        print(e)

Utils Module

read_file_lines(file_path)

reads file and returns as list of str

Parameters:

Name Type Description Default
file_path str

path of file to be read

required

Returns:

Name Type Description
list list[str]

lines read from file as list of str

Source code in pyhtools\utils.py
def read_file_lines(file_path: str) -> list[str]:
    '''reads file and returns as list of str

    Args:
        file_path (str): path of file to be read

    Returns:
        list: lines read from file as list of str 
    '''
    lines = []

    if isfile(file_path):
        with open(file_path, 'r') as f:
            lines = [line.strip() for line in f.readlines()]
            logging.debug(f"File Read: {file_path}")

    else:
        logging.error(f"File Not found at {file_path}")

    return lines