A Streamlit dashboard for analyzing crypto news sentiment (BTC / ETH / SOL / OTHER) using VADER.
It includes interactive charts (Plotly), export-ready PNGs (RGB-safe), and a print-quality PDF report (ReportLab).
Disclaimer: This project is for research and monitoring purposes only. It is not financial advice.
- Interactive charts — Source & label bar charts, daily time-series, and correlation heatmap.
- Crypto domain insights — Auto-generated summary, bullet-point analysis, recommendations, and conclusion.
- Export-ready images — Large-canvas PNGs with generous margins, forced RGB to avoid disappearing lines in PDFs.
- One-click PDF — A neatly paginated report with all charts and summary sections.
- Powerful filters — Label, source, and UTC date range.
- Pandas compatibility — Hides table index with a safe fallback for older pandas versions.
# 1) (optional) create a virtual environment
python -m venv .venv
# activate it:
# Windows: .venv\Scripts\activate
# macOS/Linux: source .venv/bin/activate
# 2) install dependencies
pip install -r requirements.txt
# 3) run the app
streamlit run streamlit_app.pyThe app reads data from data/news_raw.csv.
- Python 3.10+ (recommended)
streamlit,pandas,numpyplotly,matplotlibkaleido(PNG export backend for Plotly)reportlab,Pillow(PDF builder and image backend)
All pinned in requirements.txt.
The loader (sentiment.py) normalizes your columns automatically. Minimum required:
publishedAt/published/date→ normalized topublishedat(UTC timezone)source— outlet name/domaincompound— VADER score in[-1, +1]
Optional:
channel,title,description,url,label(iflabelis missing, it is inferred from text: BTC/ETH/SOL, else OTHER)
Example row:
publishedAt,source,compound,title,url,label
2025-08-01T10:30:00Z,CoinDesk,0.21,"BTC breaks range","https://example.com/article",BTCTip: If your dataset is large or sensitive, keep it out of your repo and list
data/*.csvin.gitignore.
When you click Build PDF report in the UI, the app:
- Saves high-resolution PNGs for each chart with large margins so labels never get cropped.
- Forces RGB (removes alpha) on the PNGs to prevent thin lines from disappearing in PDFs.
- Assembles a polished, paginated PDF using ReportLab — one chart per page, plus summaries.
About the time-series edges
The PDF version uses a small time padding by default to avoid edge clipping. You can switch to fully edge-to-edge by editing the timeseries_by_label(..., theme_for_pdf=True) x-axis range in streamlit_app.py.
.
├─ streamlit_app.py # Streamlit UI (Plotly + PDF trigger)
├─ sentiment.py # Data loader, domain analysis, print-safe charts (matplotlib), PDF builder
├─ requirements.txt
├─ data/
│ └─ news_raw.csv # Your dataset (kept local by default)
├─ charts/ # Generated PNGs (auto-created)
└─ LICENSE # MIT © 2025–present wiqilee
Adjust label colors/order in both modules if desired:
LABEL_COLORS = {"BTC": "#22c55e", "ETH": "#ffffff", "SOL": "#fde047", "OTHER": "#94a3b8"}
LABEL_ORDER = ["BTC", "ETH", "SOL", "OTHER"]-
kaleidoexport error
Ensurekaleido==0.2.1is installed:pip install --upgrade kaleido
-
Time-series lines missing in PDFs
Already handled by forcing RGB on exported PNGs. Make surePillowis installed. -
Table index won’t hide (old pandas)
The app falls back fromstyler.hide_index()tostyler.hide(axis="index")automatically.
- Automated news ingestion
- Alternative sentiment models beyond VADER
- One-click deploy to Streamlit Community Cloud
Contributions are welcome! Please open an issue or submit a pull request.
Make sure your PR includes a clear description and, when possible, screenshots of UI changes.
MIT © 2025–present wiqilee — see LICENSE for details.