Skip to main content

Python library for financial market analysis combining traditional technical indicators with LLMs, featuring real-time data processing and AI-powered market insights ⚡️

Project description

Plot

Pizzly, financial market analysis combining technical indicators with LLMs, featuring real-time data processing and AI-powered market insights ⚡️

License Maintainer Python Version Code Style Package Manager

This agentic market analysis system is a Python-based framework that combines technical analysis with artificial intelligence to provide comprehensive market insights. At its core, the system implements a modular architecture that seamlessly integrates statistical analysis methods with natural language processing capabilities.

The system's foundation is built upon two primary technical indicators: the Relative Strength Index (RSI) and Bollinger Bands. The RSI implementation provides momentum analysis through a configurable calculation window (default: 14 periods), employing dynamic gain/loss computation and rolling averages to measure the velocity and magnitude of price movements. This is complemented by a Bollinger Bands implementation that utilizes Simple Moving Averages (SMA) and dynamic standard deviation calculations to create adaptive volatility bands that automatically adjust to market conditions.

Market data acquisition is handled through an integration with the Alpaca API, providing access to historical price data across various timeframes. The system employs Polars for high-performance data manipulation, leveraging its columnar storage format and lazy evaluation capabilities to efficiently process large datasets.

The AI integration layer bridges technical analysis with natural language processing using the Qwen2.5-72B-Instruct model via the Hugging Face API. This enables sophisticated market analysis by combining traditional technical indicators with real-time news sentiment analysis through DuckDuckGo search integration.

Implementation Guide

Installation

Install the package using pip:

pip install pizzly

Usage

First, set up your API credentials as environment variables:

export ALPACA_API_KEY=your_alpaca_api_token
export ALPACA_API_SECRET=your_alpaca_api_secret
export HF_TOKEN=your_hf_token

Then use Pizzly like this:

from smolagents import DuckDuckGoSearchTool, HfApiModel
from smolagents.agents import ToolCallingAgent

from pizzly.data.alpaca import AlpacaStock
from pizzly.tools import FinancialTool

model = HfApiModel(
    "meta-llama/Llama-3.3-70B-Instruct",
    token=hf_token
)

data_provider = AlpacaStock(api_key, secret_key)
market_analysis_tool = FinancialTool(data_provider=data_provider)

search_tool = DuckDuckGoSearchTool()

agent = ToolCallingAgent(
    tools=[
        market_analysis_tool,
        search_tool
    ],
    model=model
)

prompt = f"""Please give me a detailed analysis of the market conditions for NVDA.
Include:
- Technical indicators (RSI, Bollinger Bands) using financial_tool
- Current news sentiment
- PE ratio comparison with industry
- Market trend analysis
The date of the day is {datetime.now().strftime("%Y-%m-%d")}."""

agent_output = agent.run(
    prompt
)

Development

Prerequisites

  • Python 3.11 or higher
  • uv for package management

Setting up the development environment

  1. Clone the repository:
git clone https://github.com/louisbrulenaudet/pizzly
cd pizzly
  1. Initialize the development environment:
make init

Citing this project

If you use this code in your research, please use the following BibTeX entry.

@misc{louisbrulenaudet2025,
	author = {Louis Brulé Naudet},
	title = {Pizzly, financial market analysis combining technical indicators with LLMs, featuring real-time data processing and AI-powered market insights ⚡️},
	howpublished = {\url{https://github.com/louisbrulenaudet/pizzly}},
	year = {2025}
}

Feedback

If you have any feedback, please reach out at louisbrulenaudet@icloud.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pizzly-0.1.1.tar.gz (3.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pizzly-0.1.1-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file pizzly-0.1.1.tar.gz.

File metadata

  • Download URL: pizzly-0.1.1.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.9

File hashes

Hashes for pizzly-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9c4b8f9318d8016e2062f319810bbe9cb2252767828c9beada92201a620bbe5c
MD5 e5bd8ad1b5a662c31046c8ffb32fb56f
BLAKE2b-256 033efab2aaab9b74b2abead4ca2647c2cb9e7da018c5d2f802589fa0e2e8328a

See more details on using hashes here.

File details

Details for the file pizzly-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pizzly-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.9

File hashes

Hashes for pizzly-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd6c5503142587bbd19f57514a6caacdfd37c783dbc8a1f1a35fbd24790850f2
MD5 b3f5b50ad2f544614d8a1a7ed0146534
BLAKE2b-256 779c3dfc893026bfedb2525e4165d0fd1884f6f761ce77141933ccb28191e29e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page