Overseas access: www.kdjingpai.com
Bookmark Us

MarketPulse is an open source financial information analytics push service hosted on GitHub and developed by user T1mn. It is based on Google Gemini AI that automatically captures the latest financial news, analyzes market impact, and generates reports with investment recommendations, confidence indices, and source reliability. The analysis results are pushed to users' devices in real time via Bark and PushPlus. The project is developed in Python, supports multi-device push and automated de-duplication, and is suitable for investors and developers who pay attention to the stock market. The code is open and freely contributed to by the community, and the project is licensed under the MIT license, which allows for flexible modification and use.

Function List

  • Get the latest financial news from Finnhub and other platforms automatically.
  • Analyze news with Google Gemini AI for investment advice, confidence index and source reliability.
  • Push analytics to your phone or computer via Bark and PushPlus.
  • Support for user-defined stock codes to follow and trusted news feeds.
  • Automatic de-duplication to avoid pushing the same news repeatedly.
  • Provides daemon management, supporting background running, starting, stopping and restarting.
  • The logging system records the operating status for easy debugging and monitoring.
  • Support environment variable configuration to protect API key security.

Using Help

Installation process

MarketPulse is a Python project that requires basic programming knowledge to install. Here are the detailed steps:

  1. Installation of uv (recommended)
    To efficiently manage your Python environment, it is recommended that you install the uv utility. Run the following command:

    curl -LsSf https://astral.sh/uv/install.sh | sh
    

    uv optimizes dependency resolution and improves installation efficiency.

  2. Cloning Codebase
    Use Git to clone your project locally:

    git clone https://github.com/T1mn/MarketPulse.git
    cd MarketPulse
    
  3. Create a virtual environment and install dependencies
    Create a virtual environment to isolate project dependencies:

    uv venv
    source .venv/bin/activate  # Linux/macOS
    # 或
    .venv\Scripts\activate  # Windows
    

    Install project dependencies:

    uv pip install -r requirements.txt
    uv pip install -e .
    

    Dependencies include google-generativeai,python-dotenv,schedule cap (a poem) requests etc.

  4. Configuring Environment Variables
    Copy the sample configuration file and rename it .env::

    cp .env.example .env
    

    compiler .env file, fill in the API key:

    FINNHUB_API_KEY=your_finnhub_api_key
    GEMINI_API_KEY=your_gemini_api_key
    BARK_KEY_1=your_first_bark_key
    PUSHPLUS_TOKEN=your_pushplus_token
    PUSHPLUS_TOPIC=your_topic_code
    

    Get key method:

    • Finnhub API key: Sign up for Finnhub to get it.
    • Gemini API Key: Requested through the Google Cloud platform.
    • Bark key: Obtained after installing the Bark application.
    • PushPlus Token: Sign up at PushPlus to get it.
  5. Operational services
    There are two ways to run it:

    • Front-end operation (for debugging) ::
    python -m MarketPulse.main
    
    • Running in the background (recommended) ::
    python -m MarketPulse.daemon_manager start
    

    The background operation supports process management, and the terminal can be shut down after the service is started.

Main Functions

  • Get Financial News
    MarketPulse gets the latest financial news every 30 minutes (by default) via the Finnhub API. Users can find the latest financial news in the config.py modifications NEWS_FETCH_INTERVAL Adjust the frequency:

    NEWS_FETCH_INTERVAL = 30  # 分钟
    

    Operational Steps:

    1. After starting the service, the program automatically gets news from Finnhub.
    2. available at config.py Configure trusted news feeds such as:
      TRUSTED_SOURCES = ["Reuters", "Bloomberg", "CNBC"]
      
    3. News data is saved locally for AI analysis.
  • AI Analytics and Push
    Google Gemini AI analyzes news and generates reports with investment advice, confidence index (in percent) and source reliability. Results are pushed via Bark or PushPlus.
    Operational Steps:

    1. assure .env file is configured with a Bark or PushPlus key.
    2. Once the service is running, the analysis results are automatically pushed to the configured devices.
    3. Bark pushes show up as mobile notifications, PushPlus supports WeChat pushes (see GitHub repository). img (Examples in the folder).
  • Customized Stock Monitoring
    Users can configure the ticker symbols to follow to keep track of specific company news.
    Operational Steps:

    1. compiler config.pyModifications US_MARKET_SYMBOLS::
      US_MARKET_SYMBOLS = ["AAPL", "TSLA", "MSFT"]
      
    2. After saving and restarting the service, the program will prioritize the analysis of news about these stocks.
  • daemon management
    MarketPulse supports running in the background with the following management commands:

    python -m MarketPulse.daemon_manager start   # 启动
    python -m MarketPulse.daemon_manager stop    # 停止
    python -m MarketPulse.daemon_manager restart # 重启
    python -m MarketPulse.daemon_manager status  # 查看状态
    

    The process ID is stored in the market_pulse.pid Documentation is managed automatically.

  • Log View
    The logs are saved in the logs Catalog that contains:

    • market_pulse.log: Main program log, max. 10MB, keep 5 backups.
    • daemon.log: Daemon logs, up to 5MB, keep 3 backups.
      View real-time logs:
    tail -f logs/market_pulse.log
    
  • Contribute code
    As an open source project, users can submit improvements via GitHub.
    Operational Steps:

    1. Fork Warehouse to Personal Account.
    2. Modify the code and submit a Pull Request.
    3. consultation CONTRIBUTING.md(if present) or submit questions and suggestions directly.

caveat

  • Make sure the API key is valid, Finnhub and Gemini have request limits and quotas need to be respected.
  • The first run will execute the task once immediately, and thereafter at configured intervals.
  • status file app_state.json Record processed news IDs to avoid duplicate pushes.
  • Use the uv management environment to improve the efficiency of dependency installations.
  • Log files are rotated periodically to avoid taking up too much disk space.

application scenario

  1. Investors get real-time market insights
    Investors use MarketPulse to receive AI-analyzed financial news, understand market dynamics, get investment advice, and aid in decision-making.
  2. Developers learn AI and financial data processing
    Developers can study the code and learn how to integrate Google Gemini AI, Finnhub APIs, and push services, suitable for practices in AI and finance.
  3. Corporate Monitoring Specific Stock News
    Companies can configure to follow stock symbols and get relevant news analysis for strategic planning or risk management.

QA

  1. What news feeds does MarketPulse support?
    By default, Finnhub gets its news, with support for configuring trusted sources such as Reuters, Bloomberg, etc., as described in the config.py Set in.
  2. Do I need to pay for an API?
    Yes, Finnhub and Gemini APIs require registration for keys, and some features may involve free quotas or paid plans.
  3. How do I avoid duplicate pushes?
    Project use app_state.json Records processed news IDs and automatically de-duplicates them.
  4. Can it run on a cloud server?
    Yes, it is recommended to run it in daemon mode, and it supports Linux, Windows and other systems.
  5. How do I add a new feature?
    Fork the repository, modify the code and submit a Pull Request. it is recommended to check the Issues page first to understand the community needs.
0Bookmarked
0kudos

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top

en_USEnglish