This project is completely open source. Community contributions and improvements are welcome. If you find this project helpful, please consider giving it a star ⭐️
We welcome all forms of contributions, including but not limited to:
- Submitting issues and suggestions
- Improving documentation
- Submitting code improvements
- Sharing usage experiences
MarketPulse is a lightweight financial news analysis service built on Google Gemini AI. It automatically fetches the latest financial news, performs intelligent analysis, and delivers results with clear investment advice, confidence scores, and source reliability to your devices via Bark and PushPlus.
- 🤖 Intelligent analysis powered by Google Gemini AI
- 🔔 Real-time multi-device notifications via Bark and PushPlus
- 📰 Latest financial news from Finnhub
- 📊 Provides market impact, investment advice, confidence scores, and source reliability (as percentages)
- ⚙️ Multi-channel, multi-device push support with optimized message formatting
- 🔄 Automatic deduplication to prevent repeat notifications
- 🛡️ Secure configuration using environment variables
- 🎛️ Daemon process management (start / stop / restart / status)
- 🧠 State management to automatically handle API rate limits
Click to see Bark and PushPlus notification previews
Markdown does not support embedded videos, but you can click here to see a screen recording of a Bark notification.
- Python 3.8+
- uv (recommended for Python environment management)
curl -LsSf https://astral.sh/uv/install.sh | shgit clone https://github.com/T1mn/MarketPulse.git
cd MarketPulseuv venv
source .venv/bin/activate # Linux/macOS
# or
.venv\Scripts\activate # Windows
uv pip install -r requirements.txt
uv pip install -e .Copy .env.example to .env:
cp .env.example .envEdit the .env file with your API keys:
# API Keys
FINNHUB_API_KEY=your_finnhub_api_key
GEMINI_API_KEY=your_gemini_api_key
# Bark Keys (at least one is required)
BARK_KEY_1=your_first_bark_key
# BARK_KEY_2=your_second_bark_key
# PushPlus Token (optional)
PUSHPLUS_TOKEN=your_pushplus_token
# PushPlus Topic (optional, sends to your account if left blank)
PUSHPLUS_TOPIC=your_topic_code# Run directly in the foreground (for debugging)
python -m MarketPulse.main
# Or run as a daemon in the background (recommended)
python -m MarketPulse.daemon_manager startConfigure trusted news sources in config.py:
TRUSTED_SOURCES = [
"Reuters",
"Bloomberg",
"The Wall Street Journal",
"Associated Press",
"CNBC",
"Dow Jones Newswires",
"MarketWatch"
]Configure stock symbols to monitor:
US_MARKET_SYMBOLS = [
"SPY", # S&P 500 ETF
"DIA", # Dow Jones ETF
"QQQ", # NASDAQ 100 ETF
"AAPL", # Apple
"MSFT", # Microsoft
"GOOGL", # Google
"AMZN", # Amazon
"TSLA" # Tesla
]Default news check interval is 30 minutes, can be modified in config.py:
NEWS_FETCH_INTERVAL = 30 # minutesEach notification includes:
- News headline
- AI analysis summary
- Market impact assessment
- Investment recommendations
- Related stock symbols
- News source link
- API Keys: Ensure all required API keys are configured correctly.
- Environment Management: Using
uvis recommended for better dependency resolution. - First Run: The service runs a job immediately on startup, then follows the interval set in
config.py. - State File: Processed news IDs and notifier status (e.g., rate limits) are saved in
app_state.jsonto prevent duplicate notifications and respect API limits.
Main dependencies include:
google-generativeai: Google Gemini AI interfacepython-dotenv: Environment variable managementschedule: Task schedulingrequests: HTTP requests
- Google Gemini AI - For providing powerful AI analysis capabilities
- Bark - For providing convenient push notification service
- Finnhub - For providing high-quality financial news data API
MarketPulse supports running as a daemon service with complete process management:
# Start the service
python -m MarketPulse.daemon_manager start
# Stop the service
python -m MarketPulse.daemon_manager stop
# Restart the service
python -m MarketPulse.daemon_manager restart
# Check service status
python -m MarketPulse.daemon_manager statusThe service will run completely in the background without occupying your terminal. You can safely close your terminal after starting the service.
The service uses a hierarchical logging system. All log files are stored in the logs directory:
logs/market_pulse.log: Main application logslogs/daemon.log: Daemon process logs
Monitor logs in real-time:
# View main application logs
tail -f logs/market_pulse.log
# View daemon process logs
tail -f logs/daemon.logLog files are automatically rotated:
- Main log: Maximum 10MB per file, keeps 5 backup files
- Daemon log: Maximum 5MB per file, keeps 3 backup files
The service maintains a PID file at market_pulse.pid for process management. You don't need to handle this file directly as it's managed by the daemon manager.
Key features:
- Complete detachment from terminal
- Automatic process management
- Graceful startup and shutdown
- Signal handling (SIGTERM, SIGINT)
MIT License
