finnet 0.1.0
Financial Social Network Analysis & Information Diffusion Platform - 100% FREE, No API Keys Required
License: MIT
Requires Python: >=3.9
Keywords: finance, social-network-analysis, stock-market, sentiment-analysis, graph-neural-network, gcn, network-analysis, community-detection, cascade-models, visualization, yfinance, reddit, news

# FinNet - Financial Social Network Analysis

[![PyPI version](https://badge.fury.io/py/finnet.svg)](https://pypi.org/project/finnet/)
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

**A comprehensive Financial Social Network Analysis platform with a modern CustomTkinter GUI.**

## ✨ Features

- 📊 **100% Free Data Sources** - yFinance, Reddit, Google News, RSS feeds
- 🕸️ **Complete SNA Coverage** - All 6 units of Social Network Analysis curriculum
- 🧠 **GCN from Scratch** - Pure PyTorch implementation (no PyTorch Geometric)
- 🎨 **Modern GUI** - Beautiful dark theme with CustomTkinter
- 📈 **Real-time Analysis** - Live sentiment and network metrics

## 🚀 Installation

```bash
pip install finnet
```

## 📋 Quick Start

### Launch GUI
```bash
finnet
```

### CLI Analysis
```bash
finnet --cli --tickers AAPL,MSFT,GOOGL --period 6mo
```

### Python API
```python
from finnet.data_collection import StockDataCollector, RedditJSONScraper
from finnet.network_analysis import FinancialNetworkBuilder, CommunityDetector
from finnet.machine_learning import Node2VecEmbed, GCNLayer

# Collect data
collector = StockDataCollector()
stocks = collector.get_multiple_stocks(['AAPL', 'MSFT', 'GOOGL'])

# Build network
builder = FinancialNetworkBuilder()
G = builder.build_correlation_network(stocks, threshold=0.5)

# Detect communities
detector = CommunityDetector()
communities = detector.detect_louvain(G)

# Generate embeddings
n2v = Node2VecEmbed(dimensions=64)
n2v.fit(G)
embeddings, nodes = n2v.get_all_embeddings()
```

## 📚 Syllabus Coverage

| Unit | Topic | Implementation |
|------|-------|----------------|
| 1 | Network Metrics | `NetworkMetricsCalculator` - degree, centrality, clustering |
| 2 | Link Analysis | `LinkAnalyzer` - PageRank, HITS, link prediction |
| 3 | Community Detection | `CommunityDetector` - Louvain, Girvan-Newman, Spectral |
| 4 | Cascade Models | `CascadeModel` - IC, LT, SIR/SIS epidemics |
| 5 | Anomaly Detection | `AnomalyDetector` - outliers, bridges, temporal |
| 6 | Graph ML | `GCNLayer`, `Node2VecEmbed` - FROM SCRATCH |

## 🛠️ Project Structure

```
finnet/
├── data_collection/     # yFinance, Reddit, News, RSS
├── data_processing/     # Sentiment, cleaning, features
├── network_analysis/    # Units 1-5 algorithms
├── machine_learning/    # GCN, Node2Vec (from scratch)
├── visualization/       # Matplotlib, Plotly, PyVis
├── gui/                 # CustomTkinter 9-tab interface
│   └── tabs/           # Dashboard, Input, Network, etc.
└── reports/            # PDF, Excel export
```

## 📦 Dependencies

Core: `yfinance`, `networkx`, `pandas`, `numpy`, `torch`, `customtkinter`

Optional: `gensim`, `transformers`, `pyvis`, `plotly`, `fpdf2`

## 📄 License

MIT License - see [LICENSE](LICENSE)