Ejemplo n.º 1
0
def next_day_ex_date(date: Union[str, datetime.date, None] = None,
                     filter: str = ''):
    """
    This call provides advance notification of dividend declarations impacting IEX-listed securities.

    Records are added at 8:00 a.m. ET one trading day before the specified Ex-Date. Records would have been
    communicated in the IEX Dividends Daily List when they were added or modified by the Exchange. Records are
    removed when Ex-Date is equal to today or when the record is deleted by the Exchange (in this case, a new record
    will appear in the IEX Dividends Daily List with an Event Type=DELETE for the affected Record ID).

    Updates are posted once per hour from 8:00 a.m. to 6:00 p.m. ET on each trading day.

    Args:
        date: Effective date
        filter: https://iextrading.com/developer/docs/#filter-results

    Returns:
        dict: result

    See: https://iextrading.com/developer/docs/#iex-next-day-ex-date
    """
    if date:
        date = string_or_date(date)
        return get_json('ref-data/daily-list/next-day-ex-date/' + date, filter)
    return get_json('ref-data/daily-list/next-day-ex-date', filter)
Ejemplo n.º 2
0
def historical_daily(date=None, last='', filter: str = ''):
    """
    https://iextrading.com/developer/docs/#historical-daily

    Args:
        date: fixme
        last: fixme
        filter: https://iextrading.com/developer/docs/#filter-results

    Returns:
        dict: result
    """
    if date:
        date = string_or_date(date)
        return get_json('stats/historical/daily?date=' + date, filter=filter)
    elif last:
        return get_json('stats/historical/daily?last=' + last, filter=filter)
    return get_json('stats/historical/daily', filter=filter)
Ejemplo n.º 3
0
def hist(date: Union[None, str, datetime] = None):
    """
    Hist will provide the output of IEX data products for download on a T+1 basis. Data will remain available for the
    trailing twelve months.

    Args:
        date (datetime); Effective date

    Returns:
        dict: result

    See: https://iextrading.com/developer/docs/#hist
    """

    if date is None:
        return get_json('hist')
    else:
        date = string_or_date(date)
        return get_json('hist?date=' + date)
Ejemplo n.º 4
0
def symbol_directory(date: Union[str, datetime.date, None] = None,
                     filter: str = ''):
    """
    Args:This call returns an array of all IEX-listed securities and their corresponding data fields. The IEX-Listed
    Symbol Directory Daily List is initially generated and posted to the IEX website at 8:30 p.m. Eastern Time (ET)
    before each trading day, and then once per hour from 9 p.m. until 6 p.m. ET the following day.

    Args:
        date: Effective date
        filter: https://iextrading.com/developer/docs/#filter-results

    Returns:
        dict: result

    See: https://iextrading.com/developer/docs/#iex-listed-symbol-directory
    """
    if date:
        date = string_or_date(date)
        return get_json('ref-data/daily-list/symbol-directory/' + date, filter)
    return get_json('ref-data/daily-list/symbol-directory', filter)
Ejemplo n.º 5
0
def dividends(date: Union[str, datetime.date, None] = None, filter: str = ''):
    """
    This call details upcoming dividend information and other corporate actions, such as stock splits, for IEX-listed
    securities.

    Records are added once known by the Exchange. A new record with the same Record ID as a previously communicated
    record will appear when an existing record is being modified or deleted by the Exchange. All records will be removed
    each evening.

    Updates are posted once per hour from 8:00 a.m. to 6:00 p.m. ET on each trading day

    Args:
        date: Effective date
        filter: https://iextrading.com/developer/docs/#filter-results

    Returns:
        dict: result

    See: https://iextrading.com/developer/docs/#iex-dividends
    """
    if type(date) is str:
        date = string_or_date(date)
        return get_json('ref-data/daily-list/dividends/' + date, filter)
    return get_json('ref-data/daily-list/dividends', filter)
Ejemplo n.º 6
0
def corporate_actions(date: Union[str, datetime.date, None] = None,
                      filter: str = ''):
    """
    This call returns an array of new issues, symbol and name changes, and deleted issues, as well as new firms,
    name changes, and deleted firms for IEX-listed securities.

    Records are added once known by the Exchange and will be removed when the Effective Date is in the past.

    Updates are posted once per hour from 8:00 a.m. to 6:00 p.m. ET on each trading day

    Args:
        date: Effective date
        filter: https://iextrading.com/developer/docs/#filter-results

    Returns:
        dict: result

    See: https://iextrading.com/developer/docs/#iex-corporate-actions
    """
    if date:
        date = string_or_date(date)
        return get_json('ref-data/daily-list/corporate-actions/' + date,
                        filter)
    return get_json('ref-data/daily-list/corporate-actions', filter)
Ejemplo n.º 7
0
 def test_string_or_date(self):
     string_or_date('test')
     string_or_date(datetime.now())
     with self.assertRaises(TypeError):
         string_or_date(s=5)