Metadata-Version: 2.4
Name: wavqwise
Version: 0.1.6
Summary: Pluggable temporal intelligence. Any model, Any signal, Five lines to forecast. Sense - Forecast - Alert.
Author: Venkatkumar Rajan
License: Apache-2.0
Project-URL: Homepage, https://github.com/VK-Ant/wavqwise
Project-URL: Documentation, https://github.com/VK-Ant/wavqwise#readme
Project-URL: Repository, https://github.com/VK-Ant/wavqwise
Project-URL: Issues, https://github.com/VK-Ant/wavqwise/issues
Keywords: time-series,forecasting,anomaly-detection,temporal-intelligence,signal-processing,eeg,trading,pluggable
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Requires-Dist: scipy>=1.10
Requires-Dist: matplotlib>=3.7
Requires-Dist: scikit-learn>=1.2
Requires-Dist: joblib>=1.3
Requires-Dist: pyyaml>=6.0
Requires-Dist: tqdm>=4.65
Provides-Extra: traditional
Requires-Dist: statsforecast>=1.6; extra == "traditional"
Requires-Dist: statsmodels>=0.14; extra == "traditional"
Provides-Extra: ml
Requires-Dist: xgboost>=2.0; extra == "ml"
Requires-Dist: lightgbm>=4.0; extra == "ml"
Provides-Extra: neural
Requires-Dist: torch>=2.0; extra == "neural"
Requires-Dist: neuralprophet>=0.7; extra == "neural"
Provides-Extra: foundation
Requires-Dist: transformers>=4.35; extra == "foundation"
Requires-Dist: chronos-forecasting>=1.0; extra == "foundation"
Provides-Extra: signals
Requires-Dist: mne>=1.5; extra == "signals"
Requires-Dist: PyWavelets>=1.4; extra == "signals"
Provides-Extra: trading
Requires-Dist: yfinance>=0.2; extra == "trading"
Requires-Dist: ta>=0.11; extra == "trading"
Provides-Extra: database
Requires-Dist: sqlalchemy>=2.0; extra == "database"
Requires-Dist: psycopg2-binary>=2.9; extra == "database"
Requires-Dist: pymongo>=4.5; extra == "database"
Requires-Dist: influxdb-client>=1.36; extra == "database"
Provides-Extra: viz
Requires-Dist: plotly>=5.15; extra == "viz"
Requires-Dist: seaborn>=0.12; extra == "viz"
Provides-Extra: cloud
Requires-Dist: openai>=1.0; extra == "cloud"
Requires-Dist: ollama>=0.1; extra == "cloud"
Provides-Extra: onnx-cpu
Requires-Dist: onnxruntime>=1.16; extra == "onnx-cpu"
Requires-Dist: skl2onnx>=1.16; extra == "onnx-cpu"
Provides-Extra: onnx-gpu
Requires-Dist: onnxruntime-gpu>=1.16; extra == "onnx-gpu"
Requires-Dist: skl2onnx>=1.16; extra == "onnx-gpu"
Provides-Extra: tensorrt
Requires-Dist: onnxruntime-gpu>=1.16; extra == "tensorrt"
Requires-Dist: tensorrt>=8.6; extra == "tensorrt"
Provides-Extra: export
Requires-Dist: fastapi>=0.100; extra == "export"
Requires-Dist: uvicorn>=0.23; extra == "export"
Requires-Dist: onnx>=1.14; extra == "export"
Provides-Extra: all
Requires-Dist: wavqwise[cloud,database,export,foundation,ml,neural,signals,trading,traditional,viz]; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"
Requires-Dist: pytest-cov>=4.1; extra == "dev"
Requires-Dist: ruff>=0.1; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: isort>=5.12; extra == "dev"
Requires-Dist: mypy>=1.5; extra == "dev"
Dynamic: license-file

<p align="center">
  <img src="https://raw.githubusercontent.com/VK-Ant/wavqwise/main/assets/wavqwise_hero.png" alt="WavqWise" width="70%"/>
</p>
<h1 align="center">WavqWise</h1>
<h3 align="center">Sense, Forecast, Alert.</h3>
<p align="center">Pluggable temporal intelligence, 37 models, 5 pipelines, Real-time streaming, Auto GPU.</p>

<p align="center">
    <a href="https://pypi.org/project/wavqwise/"><img src="https://img.shields.io/badge/PyPI-docqwise-blue" alt="PyPI"></a>
  <a href="https://github.com/VK-Ant/wavqwise/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-green" alt="License"/></a>
</p>

<p align="center">
  <a href="#quick-start">Quick Start</a> |
  <a href="#5-pipelines">5 Pipelines</a> |
  <a href="#37-pluggable-models">37 Models</a> |
  <a href="#real-time-streaming">Real-Time</a> |
  <a href="#weather-forecasting">Weather</a> |
  <a href="#dam-water-level-monitoring">Dam Monitoring</a> |
  <a href="#colab-notebooks">Colab</a>
</p>

---

## What Makes WavqWise Different

| Feature | Nixtla | Darts | Prophet | **WavqWise** |
|---------|--------|-------|---------|----------|
| Batch forecasting | Yes | Yes | Yes | **Yes** |
| Real-time streaming | No | No | No | **Yes** |
| Incremental update (no retrain) | No | No | No | **Yes** |
| Anomaly detection | No | No | No | **Yes** |
| EEG / Signal processing | No | No | No | **Yes** |
| Trading indicators | No | No | No | **Yes** |
| Weather (GraphCast / Aurora) | No | No | No | **Yes** |
| Dam / Water level monitoring | No | No | No | **Yes** |
| Auto GPU / ONNX / TensorRT | No | No | No | **Yes** |
| Plugin any external model | No | No | No | **Yes** |
| CLI + PNG charts + CSV/JSON export | No | No | No | **Yes** |

---

## Quick Start

```bash
pip install wavqwise
```

```python
from wavqwise import WavqPipeline

pipeline = WavqPipeline()
pipeline.load("sales.csv", target="revenue", time="date")
forecast = pipeline.forecast(horizon=30, model="arima")
forecast.plot()
```

Change `"arima"` to `"xgboost"` or `"chronos"` : same code. Model is a parameter, not an architecture decision.

---

## 5 Pipelines

### 1. WavqPipeline : Forecasting

```python
from wavqwise import WavqPipeline

pipeline = WavqPipeline()
pipeline.load("data.csv", target="sales", time="date")
forecast = pipeline.forecast(horizon=30, model="ema")

# Incremental update (not retrain)
pipeline.update(new_data)
forecast = pipeline.forecast(horizon=30)

# Compare models
pipeline.compare_models(["arima", "ema", "xgboost"], horizon=14)

# Auto-select best
pipeline.forecast(model="auto")

# Ensemble
pipeline.forecast(model=["arima", "ets", "xgboost"])
```

### 2. AnomalyPipeline : Detection with Severity

```python
from wavqwise import AnomalyPipeline

detector = AnomalyPipeline()
detector.load("sensor.csv", target="temperature", time="timestamp")
result = detector.detect(method="zscore")  # or "iqr", "isolation_forest"
print(result.summary())
# Anomalies: 93/10000 (0.9%) | Method: zscore
```

### 3. SignalPipeline : EEG & Biosignals

```python
from wavqwise import SignalPipeline

sig = SignalPipeline()
sig.load("eeg.csv", channels=["Fp1", "Fp2", "C3", "C4"], sample_rate=256)
sig.filter(low=1, high=50, notch=50)
bands = sig.extract_bands(["delta", "theta", "alpha", "beta", "gamma"])
events = sig.detect_events(threshold=3.0)
```

### 4. TradingPipeline : Financial Analysis

```python
from wavqwise.trading.indicators.momentum import RSIIndicator
from wavqwise.trading.indicators.trend import MACDIndicator
from wavqwise.trading.indicators.volatility import BollingerBandsIndicator

stock = RSIIndicator(14).compute(stock_data)
stock = MACDIndicator().compute(stock)
stock = BollingerBandsIndicator(20, 2).compute(stock)

pipeline = WavqPipeline()
pipeline.load(stock, target="Close", time="Date")
forecast = pipeline.forecast(horizon=30, model="ema")
```

### 5. WeatherPipeline : Weather Forecasting

```python
from wavqwise import WeatherPipeline

weather = WeatherPipeline()
weather.load_city("Chennai", days=365)  # Real data from Open-Meteo
forecast = weather.forecast(target="temperature_2m_mean", horizon=14, model="ema")
weather.compare_models(horizon=14)
```

---

## Real-Time Streaming

The feature no other forecasting library has:

```python
pipeline = WavqPipeline()
pipeline.load(history, target="temperature", time="timestamp")

stream = pipeline.stream(
    model="ema",
    anomaly_method="zscore",
    on_anomaly=lambda e: send_alert(e),
    on_forecast=lambda f: update_dashboard(f),
)

# Push data as it arrives
stream.push({"timestamp": "2025-01-01 10:00", "temperature": 72.3})

# Or connect to live source
stream.connect_csv("live_sensor.csv", poll_interval=5)
stream.connect_callback(my_sensor_reader, interval=1.0)

print(stream.summary())
# Stream: 500 points | 3 anomalies | window=200 | model=ema | LIVE
```

---

## Dam Water Level Monitoring

49 real dams across 13 countries. Filter by any country, state, or river.

```python
from wavqwise.weather.dam_database import DamDB

# Tamil Nadu only
DamDB.filter(country="India", state="Tamil Nadu")
# Returns: Mettur, Vaigai, Bhavanisagar, Amaravathi, Sathanur,
#          Krishnagiri, Papanasam, Sholayar (8 dams)

# California only
DamDB.filter(country="USA", state="California")
# Returns: Oroville Dam, Shasta Dam

# All Indian dams
DamDB.filter(country="India")  # 22 dams across 10 states

# Search by river
DamDB.search("cauvery")  # Mettur Dam, KRS Dam

# Big dams worldwide
DamDB.filter(min_capacity=1000)  # 14 mega dams

# All countries
DamDB.list_countries()
# Australia, Brazil, China, Egypt, Ethiopia, Ghana,
# India, Italy, Japan, Switzerland, Turkey, USA, Zimbabwe
```

### Flood Early Warning

```python
pipeline = WavqPipeline()
pipeline.load(dam_data, target="water_level_ft", time="date")
forecast = pipeline.forecast(horizon=30, model="ema")

# Real-time flood monitoring
stream = pipeline.stream(
    model="ema",
    anomaly_method="zscore",
    on_anomaly=lambda e: flood_alert(e),
)
stream.push(new_sensor_reading)
```

---

## Weather Forecasting

5 open-source weather foundation models (all free, all run locally):

| Model | By | GitHub |
|-------|-----|--------|
| GraphCast | Google DeepMind | `google-deepmind/graphcast` |
| GenCast | Google DeepMind | `google-deepmind/gencast` |
| Aurora | Microsoft | `microsoft/aurora` |
| Pangu-Weather | Huawei | `198808xc/Pangu-Weather` |
| FourCastNet | NVIDIA | `NVlabs/FourCastNet` |

Real weather data via Open-Meteo API (free, no key, 20+ cities built-in):

```python
from wavqwise import WeatherPipeline

weather = WeatherPipeline()
weather.load_city("Tokyo", days=365)
forecast = weather.forecast(target="temperature_2m_mean", horizon=30, model="ema")

# Weather indicators: heat index, wind chill, dew point, thermal comfort
# Multi-city comparison supported
```

---

## Output Formats

Four output modes : no HTML dependency required:

```python
from wavqwise.visualization.renderer import ResultRenderer, CLIPrinter, DataExporter

# PNG charts (matplotlib)
ResultRenderer.forecast_chart(history, forecast, target, time_col,
    source="India-WRIS", save_path="forecast.png")
ResultRenderer.dam_network_chart(dams, save_path="network.png")
ResultRenderer.anomaly_chart(data, save_path="anomalies.png")
ResultRenderer.comparison_chart(comparison, save_path="comparison.png")

# CLI tables (terminal)
CLIPrinter.table(["Dam", "Level", "Status"], rows)
CLIPrinter.dam_status("Mettur Dam", level=92, capacity=120)
CLIPrinter.forecast_summary(result)

# CSV / JSON export with source metadata
DataExporter.to_csv(data, "output.csv", source="india-wris.nrsc.gov.in")
DataExporter.to_json(data, "output.json", source="USGS")

# HTML interactive (optional, via folium)
from wavqwise.visualization.map_viz import WeatherMap
wmap = WeatherMap()
wmap.add_dam_marker("Mettur Dam", 11.79, 77.80, water_level=92, capacity=120)
wmap.save("dashboard.html")
```

---

## Plugin Any External Model

```python
# Way 1: Register your own class (needs fit + predict)
WavqPipeline.register("my_model", MyModelClass)
pipeline.forecast(model="my_model")

# Way 2: Wrap any sklearn model
from wavqwise.core.adapter import ModelAdapter
adapter = ModelAdapter.from_sklearn(GradientBoostingRegressor())
pipeline.forecast(model=adapter)

# Way 3: Adapters for popular PyPI libraries
from wavqwise.adapters import NixtlaAdapter, DartsAdapter, ProphetAdapter
pipeline.forecast(model=NixtlaAdapter("AutoARIMA"))
pipeline.forecast(model=DartsAdapter("NBEATSModel"))
pipeline.forecast(model=ProphetAdapter())
```

---

## Auto GPU / ONNX / TensorRT

Auto-detected on startup. No configuration needed.

```python
pipeline = WavqPipeline()
print(pipeline.runtime_info())
```

Priority: TensorRT → ONNX GPU → CUDA → MPS (Apple) → ONNX CPU → CPU

```python
from wavqwise.runtime import ONNXExporter, ONNXPredictor

exporter = ONNXExporter()
exporter.export_sklearn(model, "model.onnx", n_features=13)
exporter.optimize_for_tensorrt("model.onnx")  # FP16

predictor = ONNXPredictor("model.onnx")  # Auto GPU
result = predictor.predict(input_array)
print(predictor.benchmark(input_array))
```

---

## 37 Pluggable Models

| Category | Models |
|----------|--------|
| **Traditional (11)** | MA, EMA, ARIMA, SARIMA, ETS, Holt-Winters, Theta, CES, Croston, Naive, Seasonal Naive |
| **ML (7)** | XGBoost, LightGBM, CatBoost, Random Forest, Ridge, Lasso, ElasticNet |
| **Neural (3)** | NeuralProphet, N-BEATS, TFT |
| **Foundation (5)** | Chronos, TimesFM, Lag-Llama, Moirai, HuggingFace Hub |
| **Cloud (3)** | TimeGPT, Ollama, OpenAI |
| **Weather (5)** | GraphCast, GenCast, Aurora, Pangu-Weather, FourCastNet |
| **Custom** | Any class with fit() + predict() via `WavqPipeline.register()` |

---

## Real Data Sources (All Free, No API Key)

| Source | URL | Coverage |
|--------|-----|----------|
| Open-Meteo | api.open-meteo.com | Global weather, 80+ years history |
| India-WRIS | india-wris.nrsc.gov.in | 5000+ Indian dams |
| CWC India | cwc.gov.in | 91 major reservoirs |
| USGS | waterservices.usgs.gov | 1.5M+ US water sites |
| Global Dam Watch | globaldamwatch.org | 7000+ reservoirs worldwide |
| MNE (EEG) | mne.tools | Clinical EEG datasets |
| Yahoo Finance | via yfinance | Global stock data |

---

## Demos (11 scripts)

| Demo | What it does | Run |
|------|-------------|-----|
| Forecasting | Sales forecast + model comparison + incremental | `python demos/demo_forecasting.py` |
| Anomaly Detection | Sensor anomaly (Z-Score + IQR + severity) | `python demos/demo_anomaly_detection.py` |
| EEG Real Data | MNE clinical EEG classification | `python demos/demo_eeg_real_data.py` |
| EEG Classification | 3-class mental state classification | `python demos/demo_eeg_classification.py` |
| EEG Analysis | Band power extraction + event detection | `python demos/demo_eeg_analysis.py` |
| Trading Real Data | AAPL with RSI/MACD/Bollinger/Stochastic | `python demos/demo_trading_real_data.py` |
| Trading Forecast | Stock price forecast + signals | `python demos/demo_trading_forecast.py` |
| Weather Forecast | Temperature/rain/wind for any city | `python demos/demo_weather_forecast.py` |
| Dam Monitoring | Tamil Nadu dams, flood alerts, streaming | `python demos/demo_dam_monitoring.py` |
| Dam World | 49 dams, 13 countries, PNG + CLI + CSV output | `python demos/demo_dam_world.py` |
| Real-Time Stream | Live sensor monitoring with anomaly alerts | `python demos/demo_realtime_streaming.py` |

---

## Colab Notebooks (6 notebooks)

| Notebook | Data | Open |
|----------|------|------|
| Weather Forecast | Open-Meteo real weather | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/VK-Ant/wavqwise/blob/main/demos/notebooks/wavqwise_weather_forecast.ipynb) |
| Dam Monitoring | 49 dams, 13 countries | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/VK-Ant/wavqwise/blob/main/demos/notebooks/wavqwise_dam_monitoring.ipynb) |
| EEG Real Data | MNE clinical EEG | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/VK-Ant/wavqwise/blob/main/demos/notebooks/wavqwise_eeg_real_data.ipynb) |
| EEG Classification | Mental state classification | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/VK-Ant/wavqwise/blob/main/demos/notebooks/wavqwise_eeg_classification.ipynb) |
| Trading Real Data | yfinance AAPL/TSLA/MSFT | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/VK-Ant/wavqwise/blob/main/demos/notebooks/wavqwise_trading_real_data.ipynb) |
| Trading Forecast | Stock analysis + indicators | [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/VK-Ant/wavqwise/blob/main/demos/notebooks/wavqwise_trading_forecast.ipynb) |

---

## CLI

```bash
wavqwise forecast --input data.csv --target sales --model arima --horizon 30
wavqwise detect --input sensor.csv --target temp --method zscore
wavqwise models
```

---

## Install

```bash
pip install wavqwise                    # Core
pip install wavqwise[traditional]       # + ARIMA, SARIMA, ETS
pip install wavqwise[ml]               # + XGBoost, LightGBM
pip install wavqwise[neural]           # + NeuralProphet, N-BEATS
pip install wavqwise[foundation]       # + Chronos, TimesFM
pip install wavqwise[signals]          # + EEG (MNE)
pip install wavqwise[trading]          # + yfinance, indicators
pip install wavqwise[database]         # + PostgreSQL, MongoDB, InfluxDB
pip install wavqwise[onnx-gpu]         # + ONNX Runtime GPU
pip install wavqwise[tensorrt]         # + TensorRT
pip install wavqwise[all]              # Everything
```

---

## Docker

```bash
cd docker
docker-compose up -d
# WavqWise:    demos run automatically
# Jupyter:     localhost:8888
# TimescaleDB: localhost:5432
# Grafana:     localhost:3000
```

---

## Testing (59 tests)

```bash
make smoke        # 22 smoke tests (does it run?)
make sanity       # 20 sanity tests (is output correct?)
make ab           # 5 A/B comparison tests (which model wins?)
make integration  # 7 integration tests (full pipeline flows)
make test         # All 59 tests
```

---

## Architecture

<p align="center">
  <img src="https://raw.githubusercontent.com/VK-Ant/wavqwise/main/assets/arc.png" alt="WavqWise" width="100%"/>
</p>

---

## Ecosystem

| Library | Domain | Tagline | PyPI |
|---------|--------|---------|------|
| [SightRAG](https://github.com/VK-Ant/SightRAG) | Vision | See. Search. Retrieve. | [![PyPI](https://img.shields.io/pypi/v/sightrag?color=blue)](https://pypi.org/project/sightrag/) |
| [Sonarwise](https://github.com/VK-Ant/sonarwise) | Audio | Hear. Search. Retrieve. | [![PyPI](https://img.shields.io/pypi/v/sonarwise?color=blue)](https://pypi.org/project/sonarwise/) |
| [Docqwise](https://github.com/VK-Ant/docqwise) | Documents | Read. Extract. Retrieve. | [![PyPI](https://img.shields.io/pypi/v/docqwise?color=blue)](https://pypi.org/project/docqwise/) |
| **WavqWise** | **Temporal** | **Sense. Forecast. Alert.** | [![PyPI](https://img.shields.io/pypi/v/wavqwise?color=blue)](https://pypi.org/project/wavqwise/) |
| [Adaptive Intelligence](https://github.com/VK-Ant/adaptive-intelligence) | Orchestration | Learn. Remember. Adapt. | [![PyPI](https://img.shields.io/pypi/v/adaptive-intelligence?color=blue)](https://pypi.org/project/adaptive-intelligence/) |
| [LLMEvalKit](https://github.com/VK-Ant/llmevalkit) | Evaluation | Evaluate. Score. Improve. | [![PyPI](https://img.shields.io/pypi/v/llmevalkit?color=blue)](https://pypi.org/project/llmevalkit/) |

---

## License

Apache 2.0 License 

## Author

Venkatkumar Rajan
