finagg.indices package

Submodules

finagg.indices.api module

Indices API (symbols in popular indices).

class finagg.indices.api.API[source]

Bases: ABC

Abstract indices API.

url: ClassVar[str]

Request API URL.

abstract classmethod get(*, user_agent: None | str = None) DataFrame[source]

Main dataset API method.

classmethod get_ticker_list(*, user_agent: None | str = None) list[str][source]

List the tickers in the index.

class finagg.indices.api.DJIA[source]

Bases: API

Get data on all companies within the DJIA.

The module variable finagg.indices.api.djia is an instance of this API implementation and is the most popular interface for querying this API.

url: ClassVar[str] = 'https://en.wikipedia.org/wiki/Dow_Jones_Industrial_Average'

Request API URL.

classmethod get(*, user_agent: None | str = None) DataFrame[source]

Get a dataframe containing data on the tickers in the DJIA.

Examples

>>> finagg.indices.api.djia.get().head(5)  
            company exchange ticker                industry       added  weight
0                3M     NYSE    MMM            Conglomerate  1976-08-09  0.0241
1  American Express     NYSE    AXP      Financial services  1982-08-30  0.0302
2             Amgen   NASDAQ   AMGN       Biopharmaceutical  2020-08-31  0.0548
3             Apple   NASDAQ   AAPL  Information technology  2015-03-19  0.0284
4            Boeing     NYSE     BA   Aerospace and defense  1987-03-12  0.0336
class finagg.indices.api.Nasdaq100[source]

Bases: API

Get data on all companies within the Nasdaq 100.

The module variable finagg.indices.api.nasdaq100 is an instance of this API implementation and is the most popular interface for querying this API.

url: ClassVar[str] = 'https://en.wikipedia.org/wiki/Nasdaq-100'

Request API URL.

classmethod get(*, user_agent: None | str = None) DataFrame[source]

Get a dataframe containing data on the tickers in the Nasdaq 100.

Examples

>>> finagg.indices.api.nasdaq100.get().head(5)  
                       company ticker                industry                           sub_industry
0          Activision Blizzard   ATVI  Communication Services         Interactive Home Entertainment
1                   Adobe Inc.   ADBE  Information Technology                   Application Software
2                          ADP    ADP  Information Technology  Data Processing & Outsourced Services
3                       Airbnb   ABNB  Consumer Discretionary     Internet & Direct Marketing Retail
4             Align Technology   ALGN             Health Care                   Health Care Supplies
class finagg.indices.api.SP500[source]

Bases: API

Get data on all companies within the S&P 500.

The module variable finagg.indices.api.sp500 is an instance of this API implementation and is the most popular interface for querying this API.

url: ClassVar[str] = 'https://en.wikipedia.org/wiki/List_of_S%26P_500_companies'

Request API URL.

classmethod get(*, user_agent: None | str = None) DataFrame[source]

Get a dataframe containing data on the tickers in the S&P 500.

Examples

>>> finagg.indices.api.sp500.get().head(5)  
    ticker               company                industry ...
0      MMM                    3M             Industrials ...
1      AOS           A. O. Smith             Industrials ...
2      ABT                Abbott             Health Care ...
3     ABBV                AbbVie             Health Care ...
4      ACN             Accenture  Information Technology ...
finagg.indices.api.djia

The most popular way for accessing the DJIA API implementation.

finagg.indices.api.nasdaq100

The most popular way for accessing the Nasdaq100 API implementation.

finagg.indices.api.sp500

The most popular way for accessing the SP500 API implementation.

finagg.indices.api.get_ticker_set(*, user_agent: None | str = None) set[str][source]

Get the set of tickers from all the popular indices.

Examples

>>> "AAPL" in finagg.indices.api.get_ticker_set()  
True

finagg.indices.sql module

Indices SQLAlchemy interfaces.

finagg.indices.sql.metadata

The metadata associated with all SQL tables defined in this module.

finagg.indices.sql.djia

SQL table for storing raw data as returned by finagg.indices.api.djia (an alias for finagg.indices.api.DJIA).

finagg.indices.sql.nasdaq100

SQL table for storing raw data as returned by finagg.indices.api.nasdaq100 (an alias for finagg.indices.api.Nasdaq100).

finagg.indices.sql.sp500

SQL table for storing raw data as returned by finagg.indices.api.sp500 (an alias for finagg.indices.api.SP500).

finagg.indices.sql.get_ticker_set(*, engine: None | Engine = None) set[str][source]

Get all unique tickers in the raw SQL tables.

Parameters:

engine – Feature store database engine. Defaults to the engine at finagg.backend.engine.

Examples

>>> "AAPL" in finagg.indices.sql.get_ticker_set()
True

Module contents

Top-level indices interface.