Prompt Chain

Query Stock Market Historical Data

A LlamaIndex pack that queries historical stock market data for ticker symbols using Yahoo Finance.

Works with yahoo finance

57
Spark score
out of 100
Updated 4 days ago
Version 0.14.22
Models

Add to Favorites

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

01

Fetch historical stock prices for specified tickers.

02

Query for specific financial data points (e.g., average closing price).

03

Process and retrieve data for defined historical periods.

04

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

01
Download the StockMarketDataQueryEnginePack

Download llamapacks using llamaindex-cli with the command: llamaindex-cli download-llamapack StockMarketDataQueryEnginePack --download-dir ./stock_market_data_pack

02
Inspect downloaded files

Inspect the files at ./stock_market_data_pack and use them as a template for your own project.

03
Import and download the pack

Use download_llama_pack to download and install dependencies: StockMarketDataQueryEnginePack = download_llama_pack('StockMarketDataQueryEnginePack', './stock_market_data_pack')

04
Create the pack instance

Initialize the pack with stock tickers and period: stock_market_data_pack = StockMarketDataQueryEnginePack(['MSFT'], period='1mo')

05
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?')

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.