source

Ticker

 Ticker (symbol:str, exchange:str)

source

FilingMetadata

 FilingMetadata (accession_number:str, form_type:str, primary_doc_url:str,
                 items:str, primary_doc_description:str, filing_date:str,
                 report_date:str, cik:str, company_name:str,
                 tickers:list[__main__.Ticker])

source

RequestedFilings

 RequestedFilings (ticker_or_cik:str, form_type:str='10-Q', limit:int=1)
# Define test cases and expected results
test_cases = [
    ("3/AAPL/10-Q", RequestedFilings(limit=3, ticker_or_cik="AAPL", form_type="10-Q")),
    ("MSFT/10-K", RequestedFilings(ticker_or_cik="MSFT", form_type="10-K")),
    ("1/GOOG", RequestedFilings(limit=1, ticker_or_cik="GOOG")),
    ("BRK.A", RequestedFilings(ticker_or_cik="BRK.A")),
    ("1/0001990966/SC TO-T", RequestedFilings(limit=1, ticker_or_cik="0001990966", form_type="SC TO-T")),
    ("1/0001990966/SC TO-T/A", RequestedFilings(limit=1, ticker_or_cik="0001990966", form_type="SC TO-T/A")),
]

# Run test cases and assert expected results
for test_string, expected in test_cases:
    result = RequestedFilings.from_string(test_string)
    assert (
        result == expected
    ), f"Test case failed for input: {test_string}. Expected: {expected}, Got: {result}"

source

CompanyAndAccessionNumber

 CompanyAndAccessionNumber (ticker_or_cik:str, accession_number:str)
test_cases = [
    (
        "AAPL/0000320193-20-000052",
        CompanyAndAccessionNumber(
            ticker_or_cik="AAPL", accession_number="0000320193-20-000052"
        ),
    ),
    (
        "0001193125/000119312520036918",
        CompanyAndAccessionNumber(
            ticker_or_cik="0001193125", accession_number="000119312520036918"
        ),
    ),
    (
        "1193125/000119312520036918",
        CompanyAndAccessionNumber(
            ticker_or_cik="1193125", accession_number="000119312520036918"
        ),
    ),
    ("INVALID_STRING", None),
]

for test_input, expected in test_cases:
    result = CompanyAndAccessionNumber.from_string(test_input, must_match=False)
    assert (
        result == expected
    ), f"Test case failed for input: {test_input}. Expected: {expected}, Got: {result}"