Skip to main content

Ashare Analyzer

An intelligent A-share stock analysis system powered by LLMs with multi-agent architecture. Automatically analyzes your watchlist and delivers a "Decision Dashboard" to Discord, Telegram, or Email.

Python 3.13+ License: MIT Ruff

中文文档

Features

  • Multi-Agent Architecture: Specialized AI agents collaborate to provide comprehensive analysis

    • Technical Analysis Agent - Chart patterns, indicators, trend analysis
    • Fundamental Analysis Agent - Financial statements, valuation metrics
    • News Sentiment Agent - News aggregation and sentiment scoring
    • Chip Distribution Agent - Institutional/retail fund flow analysis
    • Risk Management Agent - Position sizing, risk assessment
    • Portfolio Manager Agent - Final decision synthesis
  • Multi-Source Data: Aggregates data from Akshare, Baostock, Tushare, eFinance, etc.

  • Flexible Notifications: Push results to Discord, Telegram, or Email

  • Multiple AI Providers: Supports 100+ LLM providers via LiteLLM (DeepSeek, OpenAI, Gemini, Claude, etc.)

  • Scheduled Execution: Run daily analysis automatically

Quick Start

Prerequisites

  • Python 3.13+

Installation

# Install with uv (recommended)
uv tool install ashare-analyzer

# Or run directly with uvx (no installation needed)
uvx ashare-analyzer

# Or install with pip
pip install ashare-analyzer

Configuration

Create a .env file in your working directory (or use environment variables):

# Copy example config (if you cloned the repo)
cp .env.example .env
# Stock watchlist (comma-separated)
STOCK_LIST=600519,300750,002594

# AI Model (LiteLLM format: provider/model-name)
LLM_MODEL=deepseek/deepseek-reasoner
LLM_API_KEY=your_api_key_here

See Configuration for all options.

Usage

# Run analysis
ashare-analyzer

# Debug mode (verbose logging)
ashare-analyzer --debug

# Analyze specific stocks
ashare-analyzer --stocks 600519,300750

# Override AI model settings via CLI
ashare-analyzer --model openai/gpt-5 --api-key your_key --base-url https://api.openai.com/v1

# Scheduled mode (runs daily at configured time)
ashare-analyzer --schedule

# Dry run (fetch data only, no AI analysis)
ashare-analyzer --dry-run

# Skip notifications
ashare-analyzer --no-notify

# Show help
ashare-analyzer --help

Configuration Details

AI Model Configuration

Supports 100+ providers via LiteLLM format:

Provider Model Example API Key Source
DeepSeek deepseek/deepseek-reasoner platform.deepseek.com
OpenAI openai/gpt-5.2 platform.openai.com
Gemini gemini/gemini-3.1-pro-preview aistudio.google.com
Claude anthropic/claude-sonnet-4-6 console.anthropic.com

Full provider list: LiteLLM Providers

Notification Channels

Configure one or more notification channels:

# Discord
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...

# Telegram
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id

# Email (SMTP)
EMAIL_SMTP_HOST=smtp.gmail.com
EMAIL_SMTP_PORT=587
EMAIL_SMTP_USER=your_email@gmail.com
EMAIL_SMTP_PASSWORD=your_app_password
EMAIL_RECIPIENTS=recipient@example.com

Search Engines (for news)

# Tavily (recommended)
TAVILY_API_KEY=your_tavily_key

# SerpAPI (alternative)
SERPAPI_API_KEY=your_serpapi_key

News Filter Configuration

The news filter uses AI to filter out low-relevance and stale news results.

Environment Variable Description Default
NEWS_FILTER_ENABLED Enable/disable news filter true
NEWS_FILTER_MIN_RESULTS Minimum results after filtering 3
NEWS_FILTER_MODEL LLM model for filtering (optional, falls back to LLM_MODEL) -

Example:

NEWS_FILTER_ENABLED=true
NEWS_FILTER_MIN_RESULTS=3
NEWS_FILTER_MODEL=deepseek/deepseek-chat

Development

# Format code
ruff format

# Lint code
ruff check --fix

# Type check
ty check .

# Run tests
uv run pytest

# Run tests with coverage
uv run pytest --cov=ashare_analyzer

Docker

# Build image
docker build -t ashare-analyzer -f docker/Dockerfile .

# Run container
docker run -it --env-file .env ashare-analyzer

# Using docker-compose
cd docker && docker-compose up -d

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments


⭐ Star this repo if you find it helpful!

Metadata

Release files for ashare-analyzer 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ashare-analyzer 0.1.1
File Size Uploaded Provenance
ashare_analyzer-0.1.1.tar.gz 152.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ashare-analyzer 0.1.1
File Interpreter ABI Platform
ashare_analyzer-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 347.4 kB

Release files / ashare_analyzer-0.1.1.tar.gz

Download URL ashare_analyzer-0.1.1.tar.gz
Size 152.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c7a5b36630beb761603f72a9b1520d8a94ce87575296fbefb28bfca116014fa5
BLAKE2b-256 checksum
How to use checksums
d319ff1aab0fdea106bf52916c85cae1132c3696ecb80e4472648587bd7ad94b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / ashare_analyzer-0.1.1-py3-none-any.whl

Download URL ashare_analyzer-0.1.1-py3-none-any.whl
Size 195.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e585a0fccf08f41e89c67ff60acb8ce9c951abcf379d7c3f088e27e92cdc63e
BLAKE2b-256 checksum
How to use checksums
2f65a393b65737fd10ef045304d52226b763ac65af71c113b86cbdbdd0cc052c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for ashare-analyzer 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page