Skip to main content

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

Project description

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

pip install seasonality-table

Usage / Kullanim

Basic Usage / Temel Kullanim

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

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

Requirements / Gereksinimler

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

License / Lisans

MIT License

Author / Yazar

cagrigungor - www.cagrigungor.com

Contact / Iletisim: iletisim@cagrigungor.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seasonality_table-0.1.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seasonality_table-0.1.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file seasonality_table-0.1.1.tar.gz.

File metadata

  • Download URL: seasonality_table-0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for seasonality_table-0.1.1.tar.gz
Algorithm Hash digest
SHA256 403e6b147c8b4f3023c1f7f70b1fb8a78abb26a3927778983f388c5705c5da6f
MD5 87cb5be556b43a6d09ed1d234f06cfbd
BLAKE2b-256 b5bd511ce53c8bc4ef826fc3c087dbacbfe83f108359ac218229464a89029dae

See more details on using hashes here.

File details

Details for the file seasonality_table-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for seasonality_table-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0c9913ccb4889f86c1f72e422be07d29903ed6eb87be5f04cb638a8b0a08de6d
MD5 d801279c155d8a10f76515f013ab7268
BLAKE2b-256 939d3261defe0c607c569a635ce988e38837fc82100e2c02c032bb38d2426708

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page