Unofficial Python SDK and CLI for the Nepal Stock Exchange (NEPSE).
pip install nepse-sdk
from nepse import NepseClient
client = NepseClient()
# Market summary
for item in client.market_summary():
print(item.detail, f"{item.value:,.2f}")
# Top gainers/losers
gainers = client.top_gainers() # top 10
losers = client.top_losers(all=True) # all losers
# Stock detail
detail = client.security_detail("NABIL")
print(detail.info.symbol, detail.trade.last_traded_price)
print(detail.info.sector)
# Dividend history
for d in client.dividends("NABIL"):
print(d.fiscal_year_nepali, f"Cash: {d.cash_dividend}%")
# All listed securities
securities = client.securities()
# Close when done
client.close()Also works as a context manager:
with NepseClient() as client:
detail = client.security_detail("NABIL")All methods return typed dataclasses with full IDE autocomplete support.
nepse market-summary # market overview
nepse top-gainers # top 10 gainers (use -a for all)
nepse top-losers # top 10 losers (use -a for all)
nepse securities # all listed securities
nepse security NABIL # stock detail by symbol
nepse dividends NABIL # dividend history by symbol
This is an unofficial tool and is not affiliated with or endorsed by NEPSE (Nepal Stock Exchange) or Nepal Stock Exchange Ltd. Use at your own risk.
MIT