Comparison
yfinance alternative for the Pakistan Stock Exchange
yfinance doesn't cover PSX. pypsx is the drop-in for Pakistani equities, same DataFrame shape, plus fundamentals, dividends, and an execution layer.
pyPSX· 10 July 2026· 1 min read
yfinance is the default for free equity data in Python, but it doesn’t cover
the Pakistan Stock Exchange. If you’re trying to backtest OGDC, HBL, or the
KSE-100, pypsx is the equivalent, built for PSX.
Side by side
| yfinance | pypsx | |
|---|---|---|
| PSX coverage | ❌ | ✓ every listed symbol |
| 10y daily OHLCV | US/global | ✓ PSX |
| Fundamentals & dividends | Limited | ✓ get_company_fundamentals, get_dividend_history |
| Index constituents | ❌ for PSX | ✓ KSE-100 / KMI-30 / KSE-30 |
| Execution / paper trading | ❌ | ✓ via pytrader |
| API key | None | None for data |
The migration is one line
# before
import yfinance as yf
df = yf.download("AAPL", period="5y")
# after
import pypsx
df = pypsx.download("OGDC", period="5y")
Same period shorthands, same pandas output. See the full yfinance → pypsx guide.
When to still use yfinance
For US or global tickers, keep using yfinance, that’s what it’s good at. pypsx
is specifically the PSX layer it never had.