snp500_data

Crates.iosnp500_data
lib.rssnp500_data
version0.2.0
sourcesrc
created_at2023-07-23 06:51:45.713161
updated_at2023-07-24 02:15:11.141541
descriptionGets updated basic information the SnP-500 constituants
homepage
repositoryhttps://github.com/austinjp17/snp500-data-retrieval
max_upload_size
id923620
size14,801
Austin Palmer (austinjp17)

documentation

README

SnP 500 Constituents Info Fetcher

This is a tool that fetches up-to-date information about the constituents of the S&P 500 index from Wikipedia. It retrieves minimal essential details: symbol, sector, industry, date added to S&P 500, and CIK identifier for each company and returns them contained in a dataframe with the companies ordered A-Z.

Introduction

The Standard & Poor's 500 Index, commonly known as the S&P 500, is a stock market index that tracks the performance of 500 large publicly traded companies in the United States. This program allows you to retrieve key information about the current constituents of the S&P 500 index from Wikipedia. The goal is to provide an easy short-cut to updated information on the United States most tracked financial index.

Example

use snp500_data;
use polars_core::prelude::*;

#[tokio::main]
async fn main() {
    let test_df: DataFrame = snp500_data::fetcher::snp_data().await.unwrap();

    // --- Columns ---
    //["symbol", "sector", "industry", "date_added", "cik"] 
    //[ String , String  ,   String  ,  String     ,String]
    
    println!("{:?}", test_df.get_column_names()) 
    println!("{:?}", test_df.get_row(0));
}

Installation

Before running the program, ensure that you have the latest stable version of Rust installed on your system. To build and install the program, use the following command:

cargo add snp500_data

Disclaimer

This dataset is intended for general analysis. Please be aware that the data is sourced from Wikipedia, which means there is a possibility of inaccuracies, and there may be a slight lag of a few days.

Commit count: 8

cargo fmt