"""
MIT License

Copyright (c) 2023 Wilhelm Ågren

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File created: 2023-10-11
Last updated: 2023-10-12
"""

from finq.datasets.dataset import Dataset

from pathlib import Path
from typing import (
    Dict,
    Union,
)

snp500_names = [
    "3M",
    "A. O. Smith",
    "Abbott",
    "AbbVie",
    "Accenture",
    "Activision Blizzard",
    "ADM",
    "Adobe Inc.",
    "ADP",
    "Advance Auto Parts",
    "AES Corporation",
    "Aflac",
    "Agilent Technologies",
    "Air Products and Chemicals",
    "Akamai",
    "Alaska Air Group",
    "Albemarle Corporation",
    "Alexandria Real Estate Equities",
    "Align Technology",
    "Allegion",
    "Alliant Energy",
    "Allstate",
    "Alphabet Inc. (Class A)",
    "Alphabet Inc. (Class C)",
    "Altria",
    "Amazon",
    "Amcor",
    "AMD",
    "Ameren",
    "American Airlines Group",
    "American Electric Power",
    "American Express",
    "American International Group",
    "American Tower",
    "American Water Works",
    "Ameriprise Financial",
    "AmerisourceBergen",
    "Ametek",
    "Amgen",
    "Amphenol",
    "Analog Devices",
    "Ansys",
    "Aon",
    "APA Corporation",
    "Apple Inc.",
    "Applied Materials",
    "Aptiv",
    "Arch Capital Group",
    "Arista Networks",
    "Arthur J. Gallagher & Co.",
    "Assurant",
    "AT&T",
    "Atmos Energy",
    "Autodesk",
    "AutoZone",
    "AvalonBay Communities",
    "Avery Dennison",
    "Axon Enterprise",
    "Baker Hughes",
    "Ball Corporation",
    "Bank of America",
    "Bath & Body Works, Inc.",
    "Baxter International",
    "Becton Dickinson",
    "Berkley",
    "Berkshire Hathaway",
    "Best Buy",
    "Bio-Rad",
    "Bio-Techne",
    "Biogen",
    "BlackRock",
    "BNY Mellon",
    "Boeing",
    "Booking Holdings",
    "BorgWarner",
    "Boston Properties",
    "Boston Scientific",
    "Bristol Myers Squibb",
    "Broadcom Inc.",
    "Broadridge Financial Solutions",
    "Brown & Brown",
    "Brown–Forman",
    "Bunge Limited",
    "C.H. Robinson",
    "Cadence Design Systems",
    "Caesars Entertainment",
    "Camden Property Trust",
    "Campbell Soup Company",
    "Capital One",
    "Cardinal Health",
    "CarMax",
    "Carnival",
    "Carrier Global",
    "Catalent",
    "Caterpillar Inc.",
    "Cboe Global Markets",
    "CBRE Group",
    "CDW",
    "Celanese",
    "Centene Corporation",
    "CenterPoint Energy",
    "Ceridian",
    "CF Industries",
    "Charles River Laboratories",
    "Charles Schwab Corporation",
    "Charter Communications",
    "Chevron Corporation",
    "Chipotle Mexican Grill",
    "Chubb Limited",
    "Church & Dwight",
    "Cigna",
    "Cincinnati Financial",
    "Cintas",
    "Cisco",
    "Citigroup",
    "Citizens Financial Group",
    "Clorox",
    "CME Group",
    "CMS Energy",
    "Coca-Cola Company (The)",
    "Cognizant",
    "Colgate-Palmolive",
    "Comcast",
    "Comerica",
    "Conagra Brands",
    "ConocoPhillips",
    "Consolidated Edison",
    "Constellation Brands",
    "Constellation Energy",
    "CooperCompanies",
    "Copart",
    "Corning Inc.",
    "Corteva",
    "CoStar Group",
    "Costco",
    "Coterra",
    "Crown Castle",
    "CSX",
    "Cummins",
    "CVS Health",
    "D.R. Horton",
    "Danaher Corporation",
    "Darden Restaurants",
    "DaVita Inc.",
    "John Deere",
    "Delta Air Lines",
    "Dentsply Sirona",
    "Devon Energy",
    "Dexcom",
    "Diamondback Energy",
    "Digital Realty",
    "Discover Financial",
    "Dish Network",
    "Disney",
    "Dollar General",
    "Dollar Tree",
    "Dominion Energy",
    "Domino's",
    "Dover Corporation",
    "Dow Inc.",
    "DTE Energy",
    "Duke Energy",
    "DuPont",
    "DXC Technology",
    "Eastman Chemical Company",
    "Eaton Corporation",
    "eBay",
    "Ecolab",
    "Edison International",
    "Edwards Lifesciences",
    "Electronic Arts",
    "Elevance Health",
    "Eli Lilly and Company",
    "Emerson Electric",
    "Enphase",
    "Entergy",
    "EOG Resources",
    "EPAM Systems",
    "EQT",
    "Equifax",
    "Equinix",
    "Equity Residential",
    "Essex Property Trust",
    "Estée Lauder Companies (The)",
    "Etsy",
    "Everest Re",
    "Evergy",
    "Eversource",
    "Exelon",
    "Expedia Group",
    "Expeditors International",
    "Extra Space Storage",
    "ExxonMobil",
    "F5, Inc.",
    "FactSet",
    "Fair Isaac",
    "Fastenal",
    "Federal Realty",
    "FedEx",
    "Fifth Third Bank",
    "First Solar",
    "FirstEnergy",
    "FIS",
    "Fiserv",
    "Fleetcor",
    "FMC Corporation",
    "Ford Motor Company",
    "Fortinet",
    "Fortive",
    "Fox Corporation (Class A)",
    "Fox Corporation (Class B)",
    "Franklin Templeton",
    "Freeport-McMoRan",
    "Garmin",
    "Gartner",
    "GE HealthCare",
    "Gen Digital",
    "Generac",
    "General Dynamics",
    "General Electric",
    "General Mills",
    "General Motors",
    "Genuine Parts Company",
    "Gilead Sciences",
    "Globe Life",
    "Global Payments",
    "Goldman Sachs",
    "Halliburton",
    "Hartford (The)",
    "Hasbro",
    "HCA Healthcare",
    "Healthpeak",
    "Henry Schein",
    "Hershey's",
    "Hess Corporation",
    "Hewlett Packard Enterprise",
    "Hilton Worldwide",
    "Hologic",
    "Home Depot (The)",
    "Honeywell",
    "Hormel Foods",
    "Host Hotels & Resorts",
    "Howmet Aerospace",
    "HP Inc.",
    "Humana",
    "Huntington Bancshares",
    "Huntington Ingalls Industries",
    "IBM",
    "IDEX Corporation",
    "Idexx Laboratories",
    "Illinois Tool Works",
    "Illumina",
    "Incyte",
    "Ingersoll Rand",
    "Insulet",
    "Intel",
    "Intercontinental Exchange",
    "International Flavors & Fragrances",
    "International Paper",
    "Interpublic Group of Companies (The)",
    "Intuit",
    "Intuitive Surgical",
    "Invesco",
    "Invitation Homes",
    "IQVIA",
    "Iron Mountain",
    "J.B. Hunt",
    "Jack Henry & Associates",
    "Jacobs Solutions",
    "Johnson & Johnson",
    "Johnson Controls",
    "JPMorgan Chase",
    "Juniper Networks",
    "Kellogg's",
    "Keurig Dr Pepper",
    "KeyCorp",
    "Keysight",
    "Kimberly-Clark",
    "Kimco Realty",
    "Kinder Morgan",
    "KLA Corporation",
    "Kraft Heinz",
    "Kroger",
    "L3Harris",
    "LabCorp",
    "Lam Research",
    "Lamb Weston",
    "Las Vegas Sands",
    "Leidos",
    "Lennar",
    "Lincoln Financial",
    "Linde plc",
    "Live Nation Entertainment",
    "LKQ Corporation",
    "Lockheed Martin",
    "Loews Corporation",
    "Lowe's",
    "LyondellBasell",
    "M&T Bank",
    "Marathon Oil",
    "Marathon Petroleum",
    "MarketAxess",
    "Marriott International",
    "Marsh McLennan",
    "Martin Marietta Materials",
    "Masco",
    "Mastercard",
    "Match Group",
    "McCormick & Company",
    "McDonald's",
    "McKesson",
    "Medtronic",
    "Merck & Co.",
    "Meta Platforms",
    "MetLife",
    "Mettler Toledo",
    "MGM Resorts",
    "Microchip Technology",
    "Micron Technology",
    "Microsoft",
    "Mid-America Apartment Communities",
    "Moderna",
    "Mohawk Industries",
    "Molina Healthcare",
    "Molson Coors Beverage Company",
    "Mondelez International",
    "Monolithic Power Systems",
    "Monster Beverage",
    "Moody's Corporation",
    "Morgan Stanley",
    "Mosaic Company (The)",
    "Motorola Solutions",
    "MSCI",
    "Nasdaq, Inc.",
    "NetApp",
    "Netflix",
    "Newell Brands",
    "Newmont",
    "News Corp (Class A)",
    "News Corp (Class B)",
    "NextEra Energy",
    "Nike, Inc.",
    "NiSource",
    "Nordson Corporation",
    "Norfolk Southern Railway",
    "Northern Trust",
    "Northrop Grumman",
    "Norwegian Cruise Line Holdings",
    "NRG Energy",
    "Nucor",
    "Nvidia",
    "NVR, Inc.",
    "NXP Semiconductors",
    "O'Reilly Auto Parts",
    "Occidental Petroleum",
    "Old Dominion",
    "Omnicom Group",
    "ON Semiconductor",
    "ONEOK",
    "Oracle Corporation",
    "Organon & Co.",
    "Otis Worldwide",
    "Paccar",
    "Packaging Corporation of America",
    "Paramount Global",
    "Parker Hannifin",
    "Paychex",
    "Paycom",
    "PayPal",
    "Pentair",
    "PepsiCo",
    "Pfizer",
    "PG&E Corporation",
    "Philip Morris International",
    "Phillips 66",
    "Pinnacle West",
    "Pioneer Natural Resources",
    "PNC Financial Services",
    "Pool Corporation",
    "PPG Industries",
    "PPL Corporation",
    "Principal Financial Group",
    "Procter & Gamble",
    "Progressive Corporation",
    "Prologis",
    "Prudential Financial",
    "Public Service Enterprise Group",
    "PTC",
    "Public Storage",
    "PulteGroup",
    "Qorvo",
    "Quanta Services",
    "Qualcomm",
    "Quest Diagnostics",
    "Ralph Lauren Corporation",
    "Raymond James",
    "Raytheon Technologies",
    "Realty Income",
    "Regency Centers",
    "Regeneron",
    "Regions Financial Corporation",
    "Republic Services",
    "ResMed",
    "Revvity",
    "Robert Half",
    "Rockwell Automation",
    "Rollins, Inc.",
    "Roper Technologies",
    "Ross Stores",
    "Royal Caribbean Group",
    "S&P Global",
    "Salesforce",
    "SBA Communications",
    "Schlumberger",
    "Seagate Technology",
    "Sealed Air",
    "Sempra Energy",
    "ServiceNow",
    "Sherwin-Williams",
    "Simon Property Group",
    "Skyworks Solutions",
    "J.M. Smucker Company (The)",
    "Snap-on",
    "SolarEdge",
    "Southern Company",
    "Southwest Airlines",
    "Stanley Black & Decker",
    "Starbucks",
    "State Street Corporation",
    "Steel Dynamics",
    "Steris",
    "Stryker Corporation",
    "Synchrony Financial",
    "Synopsys",
    "Sysco",
    "T-Mobile US",
    "T. Rowe Price",
    "Take-Two Interactive",
    "Tapestry, Inc.",
    "Targa Resources",
    "Target Corporation",
    "TE Connectivity",
    "Teledyne Technologies",
    "Teleflex",
    "Teradyne",
    "Tesla, Inc.",
    "Texas Instruments",
    "Textron",
    "Thermo Fisher Scientific",
    "TJX Companies",
    "Tractor Supply",
    "Trane Technologies",
    "TransDigm Group",
    "Travelers Companies (The)",
    "Trimble Inc.",
    "Truist",
    "Tyler Technologies",
    "Tyson Foods",
    "U.S. Bank",
    "UDR, Inc.",
    "Ulta Beauty",
    "Union Pacific Corporation",
    "United Airlines Holdings",
    "United Parcel Service",
    "United Rentals",
    "UnitedHealth Group",
    "Universal Health Services",
    "Valero Energy",
    "Ventas",
    "Verisign",
    "Verisk",
    "Verizon",
    "Vertex Pharmaceuticals",
    "VF Corporation",
    "Viatris",
    "Vici Properties",
    "Visa Inc.",
    "Vulcan Materials Company",
    "Wabtec",
    "Walgreens Boots Alliance",
    "Walmart",
    "Warner Bros. Discovery",
    "Waste Management",
    "Waters Corporation",
    "WEC Energy Group",
    "Wells Fargo",
    "Welltower",
    "West Pharmaceutical Services",
    "Western Digital",
    "WestRock",
    "Weyerhaeuser",
    "Whirlpool Corporation",
    "Williams Companies",
    "Willis Towers Watson",
    "W. W. Grainger",
    "Wynn Resorts",
    "Xcel Energy",
    "Xylem Inc.",
    "Yum! Brands",
    "Zebra Technologies",
    "Zimmer Biomet",
    "Zions Bancorporation",
    "Zoetis",
]

snp500_symbols = [
    "MMM",
    "AOS",
    "ABT",
    "ABBV",
    "ACN",
    "ATVI",
    "ADM",
    "ADBE",
    "ADP",
    "AAP",
    "AES",
    "AFL",
    "A",
    "APD",
    "AKAM",
    "ALK",
    "ALB",
    "ARE",
    "ALGN",
    "ALLE",
    "LNT",
    "ALL",
    "GOOGL",
    "GOOG",
    "MO",
    "AMZN",
    "AMCR",
    "AMD",
    "AEE",
    "AAL",
    "AEP",
    "AXP",
    "AIG",
    "AMT",
    "AWK",
    "AMP",
    "ABC",
    "AME",
    "AMGN",
    "APH",
    "ADI",
    "ANSS",
    "AON",
    "APA",
    "AAPL",
    "AMAT",
    "APTV",
    "ACGL",
    "ANET",
    "AJG",
    "AIZ",
    "T",
    "ATO",
    "ADSK",
    "AZO",
    "AVB",
    "AVY",
    "AXON",
    "BKR",
    "BALL",
    "BAC",
    "BBWI",
    "BAX",
    "BDX",
    "WRB",
    "BRK.B",
    "BBY",
    "BIO",
    "TECH",
    "BIIB",
    "BLK",
    "BK",
    "BA",
    "BKNG",
    "BWA",
    "BXP",
    "BSX",
    "BMY",
    "AVGO",
    "BR",
    "BRO",
    "BF.B",
    "BG",
    "CHRW",
    "CDNS",
    "CZR",
    "CPT",
    "CPB",
    "COF",
    "CAH",
    "KMX",
    "CCL",
    "CARR",
    "CTLT",
    "CAT",
    "CBOE",
    "CBRE",
    "CDW",
    "CE",
    "CNC",
    "CNP",
    "CDAY",
    "CF",
    "CRL",
    "SCHW",
    "CHTR",
    "CVX",
    "CMG",
    "CB",
    "CHD",
    "CI",
    "CINF",
    "CTAS",
    "CSCO",
    "C",
    "CFG",
    "CLX",
    "CME",
    "CMS",
    "KO",
    "CTSH",
    "CL",
    "CMCSA",
    "CMA",
    "CAG",
    "COP",
    "ED",
    "STZ",
    "CEG",
    "COO",
    "CPRT",
    "GLW",
    "CTVA",
    "CSGP",
    "COST",
    "CTRA",
    "CCI",
    "CSX",
    "CMI",
    "CVS",
    "DHI",
    "DHR",
    "DRI",
    "DVA",
    "DE",
    "DAL",
    "XRAY",
    "DVN",
    "DXCM",
    "FANG",
    "DLR",
    "DFS",
    "DISH",
    "DIS",
    "DG",
    "DLTR",
    "D",
    "DPZ",
    "DOV",
    "DOW",
    "DTE",
    "DUK",
    "DD",
    "DXC",
    "EMN",
    "ETN",
    "EBAY",
    "ECL",
    "EIX",
    "EW",
    "EA",
    "ELV",
    "LLY",
    "EMR",
    "ENPH",
    "ETR",
    "EOG",
    "EPAM",
    "EQT",
    "EFX",
    "EQIX",
    "EQR",
    "ESS",
    "EL",
    "ETSY",
    "RE",
    "EVRG",
    "ES",
    "EXC",
    "EXPE",
    "EXPD",
    "EXR",
    "XOM",
    "FFIV",
    "FDS",
    "FICO",
    "FAST",
    "FRT",
    "FDX",
    "FITB",
    "FSLR",
    "FE",
    "FIS",
    "FISV",
    "FLT",
    "FMC",
    "F",
    "FTNT",
    "FTV",
    "FOXA",
    "FOX",
    "BEN",
    "FCX",
    "GRMN",
    "IT",
    "GEHC",
    "GEN",
    "GNRC",
    "GD",
    "GE",
    "GIS",
    "GM",
    "GPC",
    "GILD",
    "GL",
    "GPN",
    "GS",
    "HAL",
    "HIG",
    "HAS",
    "HCA",
    "PEAK",
    "HSIC",
    "HSY",
    "HES",
    "HPE",
    "HLT",
    "HOLX",
    "HD",
    "HON",
    "HRL",
    "HST",
    "HWM",
    "HPQ",
    "HUM",
    "HBAN",
    "HII",
    "IBM",
    "IEX",
    "IDXX",
    "ITW",
    "ILMN",
    "INCY",
    "IR",
    "PODD",
    "INTC",
    "ICE",
    "IFF",
    "IP",
    "IPG",
    "INTU",
    "ISRG",
    "IVZ",
    "INVH",
    "IQV",
    "IRM",
    "JBHT",
    "JKHY",
    "J",
    "JNJ",
    "JCI",
    "JPM",
    "JNPR",
    "K",
    "KDP",
    "KEY",
    "KEYS",
    "KMB",
    "KIM",
    "KMI",
    "KLAC",
    "KHC",
    "KR",
    "LHX",
    "LH",
    "LRCX",
    "LW",
    "LVS",
    "LDOS",
    "LEN",
    "LNC",
    "LIN",
    "LYV",
    "LKQ",
    "LMT",
    "L",
    "LOW",
    "LYB",
    "MTB",
    "MRO",
    "MPC",
    "MKTX",
    "MAR",
    "MMC",
    "MLM",
    "MAS",
    "MA",
    "MTCH",
    "MKC",
    "MCD",
    "MCK",
    "MDT",
    "MRK",
    "META",
    "MET",
    "MTD",
    "MGM",
    "MCHP",
    "MU",
    "MSFT",
    "MAA",
    "MRNA",
    "MHK",
    "MOH",
    "TAP",
    "MDLZ",
    "MPWR",
    "MNST",
    "MCO",
    "MS",
    "MOS",
    "MSI",
    "MSCI",
    "NDAQ",
    "NTAP",
    "NFLX",
    "NWL",
    "NEM",
    "NWSA",
    "NWS",
    "NEE",
    "NKE",
    "NI",
    "NDSN",
    "NSC",
    "NTRS",
    "NOC",
    "NCLH",
    "NRG",
    "NUE",
    "NVDA",
    "NVR",
    "NXPI",
    "ORLY",
    "OXY",
    "ODFL",
    "OMC",
    "ON",
    "OKE",
    "ORCL",
    "OGN",
    "OTIS",
    "PCAR",
    "PKG",
    "PARA",
    "PH",
    "PAYX",
    "PAYC",
    "PYPL",
    "PNR",
    "PEP",
    "PFE",
    "PCG",
    "PM",
    "PSX",
    "PNW",
    "PXD",
    "PNC",
    "POOL",
    "PPG",
    "PPL",
    "PFG",
    "PG",
    "PGR",
    "PLD",
    "PRU",
    "PEG",
    "PTC",
    "PSA",
    "PHM",
    "QRVO",
    "PWR",
    "QCOM",
    "DGX",
    "RL",
    "RJF",
    "RTX",
    "O",
    "REG",
    "REGN",
    "RF",
    "RSG",
    "RMD",
    "RVTY",
    "RHI",
    "ROK",
    "ROL",
    "ROP",
    "ROST",
    "RCL",
    "SPGI",
    "CRM",
    "SBAC",
    "SLB",
    "STX",
    "SEE",
    "SRE",
    "NOW",
    "SHW",
    "SPG",
    "SWKS",
    "SJM",
    "SNA",
    "SEDG",
    "SO",
    "LUV",
    "SWK",
    "SBUX",
    "STT",
    "STLD",
    "STE",
    "SYK",
    "SYF",
    "SNPS",
    "SYY",
    "TMUS",
    "TROW",
    "TTWO",
    "TPR",
    "TRGP",
    "TGT",
    "TEL",
    "TDY",
    "TFX",
    "TER",
    "TSLA",
    "TXN",
    "TXT",
    "TMO",
    "TJX",
    "TSCO",
    "TT",
    "TDG",
    "TRV",
    "TRMB",
    "TFC",
    "TYL",
    "TSN",
    "USB",
    "UDR",
    "ULTA",
    "UNP",
    "UAL",
    "UPS",
    "URI",
    "UNH",
    "UHS",
    "VLO",
    "VTR",
    "VRSN",
    "VRSK",
    "VZ",
    "VRTX",
    "VFC",
    "VTRS",
    "VICI",
    "V",
    "VMC",
    "WAB",
    "WBA",
    "WMT",
    "WBD",
    "WM",
    "WAT",
    "WEC",
    "WFC",
    "WELL",
    "WST",
    "WDC",
    "WRK",
    "WY",
    "WHR",
    "WMB",
    "WTW",
    "GWW",
    "WYNN",
    "XEL",
    "XYL",
    "YUM",
    "ZBRA",
    "ZBH",
    "ZION",
    "ZTS",
]


class SNP500(Dataset):
    """ """

    def __init__(
        self,
        *,
        save_path: Union[str, Path] = ".data/SNP500/",
        **kwargs: Dict,
    ):
        """ """

        super(SNP500, self).__init__(
            snp500_names,
            snp500_symbols,
            save_path=save_path,
            **kwargs,
        )
