Beta Space StudioBeta Space Studio logo
🛠️ Dev Tools

borsapy

Turkey-specific finance library. A yfinance-like Python package for BIST stock data, forex, crypto, TEFAS and more.

by Said Sürücü166 stars
borsapy

Overview

While building Borsa MCP, we realized there was no Turkey-specific finance library like yfinance, and Yahoo Finance had incomplete or incorrect data for Turkish markets. We had to build everything from scratch.

So we extracted the data sources from Borsa MCP into a yfinance-like Python library. Introducing borsapy!

Features

Stocks (BIST - Borsa Istanbul)

  • Real-time price, volume, market cap
  • Historical OHLCV data (daily, hourly)
  • Balance sheet, income statement, cash flow
  • Dividend and capital increase history
  • Shareholder structure
  • Analyst target prices
  • KAP announcements (Public Disclosure Platform - Turkey's SEC filings equivalent)
  • ISIN codes

Forex & Commodities

  • USD, EUR, GBP and other exchange rates against TRY
  • Gold prices (gram, quarter, half, full coins - traditional Turkish gold denominations)
  • Silver prices
  • Historical exchange rate data

Cryptocurrency

  • BTC, ETH, XRP and 50+ pairs
  • Real-time price and volume
  • Historical OHLCV data

Mutual Funds (TEFAS)

  • Fund search and information (TEFAS is Turkey's Electronic Fund Distribution Platform)
  • Fund price history

Indices

  • XU100 (BIST 100 - main benchmark, similar to S&P 500)
  • XU030 (BIST 30 - blue chips)
  • XBANK (Banking sector index)
  • And more sector indices

Futures & Options (VIOP)

  • All futures contracts (VIOP is Borsa Istanbul Derivatives Market)
  • Options data

Inflation

  • CPI (Consumer Price Index) data
  • Inflation calculator

Installation

pip install borsapy

Usage Example

from borsapy import Stock

# Get stock info
stock = Stock("THYAO")  # THYAO = Turkish Airlines
print(stock.price)
print(stock.info)

# Historical data
history = stock.history(period="1y")
print(history)

Why borsapy?

We believe this will make life much easier for developers working with Turkish financial data. Problems with existing solutions:

  • Yahoo Finance: Incomplete and incorrect data for Turkish markets
  • Other APIs: Paid or limited access
  • Manual solutions: Code that needs to be written from scratch for every project

borsapy solves all these problems, offering an open-source gift to the Turkish developer community.

Contribute

The project is open source and welcomes community contributions. You can open issues or submit pull requests on GitHub.

borsapy - Resources | Beta Space Studio | Beta Space Studio