From aa54f3aad48bb4dd2a82267056ede0eba641bd66 Mon Sep 17 00:00:00 2001 From: Marcel Weschke Date: Wed, 20 May 2026 12:14:36 +0200 Subject: [PATCH] Added additional CLI usage informations --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/README.md b/README.md index 2d02533..93c4db2 100644 --- a/README.md +++ b/README.md @@ -56,3 +56,48 @@ Resamples the extracted signals to a weekly frequency and performs quantitative Install the required quantitative stack: ```bash pip install pytrends pandas numpy scikit-learn yfinance matplotlib +``` + +### Command Line Interface (CLI) Usage +The script features a fully parameterized CLI. You can customize the geographic scope, validation benchmark, time horizons, Google properties, and the anchor term itself. + +```bash +# Display the full help menu and options +python google_trends_sentiment_prototype.py -h +``` + +### Advanced CLI Examples: +```bash +# 1. Standard global run validating against the MSCI World ETF (URTH) +python google_trends_sentiment_prototype.py --geo GLOBAL --ticker URTH + +# 2. Localized analysis for Germany validating against the DAX over a specific 5-year period +python google_trends_sentiment_prototype.py --geo DE --ticker ^GDAXI --timeframe "today 5-y" + +# 3. Target Google News specifically rather than general web search, disabling visual plots +python google_trends_sentiment_prototype.py --gprop news --no-plot + +# 4. Change the anchor term to a custom high-volume baseline +python google_trends_sentiment_prototype.py --anchor "news" --ticker URTH +``` + +### Full CLI Arguments Reference: +**Flag**,**Type**,**Default**,**Description** +```bash +"-h, --help",Flag,-,Show the help message and exit. +--geo GEO,String,'GLOBAL',"Geographic region code (ISO 3166-1 alpha-2). E.g., 'US', 'DE'." +--ticker TICKER,String,None,"Yahoo Finance ticker symbol for validation (e.g., '^GSPC', 'URTH')." +--timeframe TIMEFRAME,String,'today 5-y',"Data duration. Supports 'today 12-m', 'today 5-y', or specific 'YYYY-MM-DD YYYY-MM-DD'." +--gprop GPROP,String,'' (Web),"Google property filter. Supports '' (Web Search), 'news', 'images', 'froogle', or 'youtube'." +--anchor ANCHOR,String,'weather',Reference term used to rescale and link multiple keyword batches together. +--no-plot,Flag,False,Disables visual plot generation (.png) and only serializes the computed CSV data. +``` + +### Generated Outputs +he pipeline structures and serializes its findings into the following artifacts (where represents your chosen region code): + +- `trends_raw_.csv`: The compiled, raw Google Trends search intensities. +- `trends_features_.csv`: The engineered feature set post-Z-score transformation. +- `sentiment_data_.csv`: The final calculated Sentiment Spread and Macro PCA Factor. +- `sentiment_plot_.png` / `combined_sentiment_analysis_.png`: Visual correlation plots mapping the extracted sentiment against your chosen financial benchmark. +