Query Stock Market Historical Data
A LlamaIndex pack that queries historical stock market data for ticker symbols using Yahoo Finance.
Why it matters
Access and analyze historical stock market data from Yahoo Finance. Retrieve specific financial information for given stock tickers and periods.
Outcomes
What it gets done
Fetch historical stock prices for specified tickers.
Query for specific financial data points (e.g., average closing price).
Process and retrieve data for defined historical periods.
Integrate with Yahoo Finance API for data retrieval.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-pack-packs-stock-market-data-query-engine | bash Steps
Steps in the chain
Download llamapacks using llamaindex-cli with the command: llamaindex-cli download-llamapack StockMarketDataQueryEnginePack --download-dir ./stock_market_data_pack
Inspect the files at ./stock_market_data_pack and use them as a template for your own project.
Use download_llama_pack to download and install dependencies: StockMarketDataQueryEnginePack = download_llama_pack('StockMarketDataQueryEnginePack', './stock_market_data_pack')
Initialize the pack with stock tickers and period: stock_market_data_pack = StockMarketDataQueryEnginePack(['MSFT'], period='1mo')
Use the run() function to query the engine: response = stock_market_data_pack.run('What is the average closing price for MSFT?')
Overview
Stock Market Data Query Engine Pack
What it does
A LlamaIndex pack that fetches historical stock market data using Yahoo Finance
How it connects
When you need to retrieve historical stock prices for ticker symbols in your LLM application
Source README
Description pending for li-pack-packs-stock-market-data-query-engine.
Step 1: Download the StockMarketDataQueryEnginePack
Download llamapacks using llamaindex-cli with the command: llamaindex-cli download-llamapack StockMarketDataQueryEnginePack --download-dir ./stock_market_data_pack
Step 2: Inspect downloaded files
Inspect the files at ./stock_market_data_pack and use them as a template for your own project.
Step 3: Import and download the pack
Use download_llama_pack to download and install dependencies: StockMarketDataQueryEnginePack = download_llama_pack('StockMarketDataQueryEnginePack', './stock_market_data_pack')Step 4: Create the pack instance
Initialize the pack with stock tickers and period: stock_market_data_pack = StockMarketDataQueryEnginePack(['MSFT'], period='1mo')
Step 5: Query the pack
Use the run() function to query the engine: response = stock_market_data_pack.run('What is the average closing price for MSFT?')Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.