from typing import Tuple
from typing import List


def load_hurdat(filepath: str) -> Tuple[List[str], List[str]]:
    """
    Extracts hurricane data from hurdat2.txt file

    Parameters
    ----------

    filepath : The pathname to the hurdat2.txt file


    Return
    ------

    tracks : List[str]
                Contains all geographical data from hurdat2.txt
    hurricanes : List[str]
                Contains all hurricanes with ID, name and number of corresponding data points
    """

    # Loading the text file:
    tracks = []
    hurricanes = []

    # When reading the text file, we separate two possible line formats: whether the line contains an ID or not. This is
    # due to the fact that ID's are followed by the corresponding data points without anymore mention of the ID.
    # So it will be easier, later on to just add the ID's separately.
    with open(filepath) as text:
        for line in text:

            if line.startswith('AL'):
                hurricanes.append(line)
            else:
                tracks.append(line)

    print(hurricanes[:5])
    print('\n')
    print(tracks[:15])
    print('\n')
    print('There are {} different hurricanes, for a total of {} measurements.'
          .format(len(hurricanes), len(tracks)))
    print('\n')

    return tracks, hurricanes