# seasonality-table

A Python library to generate monthly returns (seasonality) tables for financial analysis.

Finansal analiz icin aylik getiri (mevsimsellik) tablolari olusturan bir Python kutuphanesi.

---

## Installation / Kurulum

```bash
pip install seasonality-table
```

## Usage / Kullanim

### Basic Usage / Temel Kullanim

```python
from seasonality_table import get_returns_table

# Get Bitcoin monthly returns table
# Bitcoin aylik getiri tablosu
table = get_returns_table("BTC-USD")
table
```

### Parameters / Parametreler

| Parameter | Type | Default | Description (EN) | Aciklama (TR) |
|-----------|------|---------|------------------|---------------|
| ticker | str | "BTC-USD" | Ticker symbol | Hisse/kripto sembol |
| is_colored | bool | True | Color coded output | Renkli cikti |
| start_date | str | "2010-01-01" | Start date (YYYY-MM-DD) | Baslangic tarihi |
| end_date | str | Today | End date (YYYY-MM-DD) | Bitis tarihi |
| column | str | "Close" | Price column to use | Kullanilacak fiyat sutunu |
| date | str | "index" | Date column name | Tarih sutun adi |
| df | DataFrame | None | Custom DataFrame | Ozel DataFrame |

### Examples / Ornekler

```python
from seasonality_table import get_returns_table

# Example 1: Stock data without colors
# Ornek 1: Renksiz hisse verisi
table = get_returns_table("AAPL", is_colored=False)

# Example 2: Custom date range
# Ornek 2: Ozel tarih araligi
table = get_returns_table("MSFT", start_date="2020-01-01", end_date="2024-12-31")

# Example 3: Using Open price instead of Close
# Ornek 3: Close yerine Open fiyati kullanma
table = get_returns_table("BTC-USD", column="Open")

# Example 4: Using custom DataFrame
# Ornek 4: Ozel DataFrame kullanma
import pandas as pd
my_df = pd.read_csv("my_data.csv")
table = get_returns_table(df=my_df, column="price", date="date_column")
```

### Output / Cikti

The function returns a pivot table showing monthly returns (%) by year and month.

Fonksiyon, yil ve aya gore aylik getirileri (%) gosteren bir pivot tablo dondurur.

- Green cells: Positive returns / Yesil hucreler: Pozitif getiri
- Red cells: Negative returns / Kirmizi hucreler: Negatif getiri

### Example Output / Ornek Cikti

![BTC Monthly Returns Table / BTC Aylik Getiri Tablosu](https://www.cagrigungor.com/wp-content/uploads/2026/03/demo.png)

## Requirements / Gereksinimler

- Python >= 3.8
- pandas >= 1.0.0
- yfinance >= 0.2.0

## License / Lisans

MIT License

## Author / Yazar

cagrigungor - [www.cagrigungor.com](https://www.cagrigungor.com)

Contact / Iletisim: iletisim@cagrigungor.com
