Skip to main content

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

Project description

sessionalty-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 sessionalty-table

Usage / Kullanim

Basic Usage / Temel Kullanim

from sessionalty_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 sessionalty_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

sessionalty_table-0.1.0.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.

sessionalty_table-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file sessionalty_table-0.1.0.tar.gz.

File metadata

  • Download URL: sessionalty_table-0.1.0.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 sessionalty_table-0.1.0.tar.gz
Algorithm Hash digest
SHA256 00c99f98219c906e7f9d7d766ca28a1de803fbf6c7d8e4c93fb5e4684514b5fc
MD5 bffcbe0086c6f328c8edf3c9e723d6f8
BLAKE2b-256 d5dbbeec7fd8be1e579cf71c995e702cff23994677877403795f1f1e8d71800e

See more details on using hashes here.

File details

Details for the file sessionalty_table-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sessionalty_table-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 318a09431284460ab50c919bad9c9e677657b9368291be434595296822c44876
MD5 81332963152d41104cb2cdb0e1611b20
BLAKE2b-256 d718efee8ec75843d424e9c485ab04df2ab9b7e29c0279aaec9f2a9241ca946a

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