from typing import Union
from typing import Tuple
from pathlib import Path
import json


def get_profile_by_cik(cik:Union[str,int]) -> Union[None,Tuple[int,str,str]]:
    """
    gets the company profile using the CIK number

    Args:
        cik (Union[str,int]): the SEC issued Central Index Key (CIK)

    Returns:
        Union[None,Tuple[int,str,str]]: (cik, ticker, title)
    """
    path = Path(__file__).resolve().parent.parent.joinpath('resources', 'cik.json')
    cik_json = json.load(open(path))
    result = cik_json.get(str(cik), None)
    if result is None:
        return result
    return tuple(result.values())