Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nepse-sdk

Unofficial Python SDK and CLI for the Nepal Stock Exchange (NEPSE).

Installation

pip install nepse-sdk

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.

CLI

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

Docs

Disclaimer

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.

License

MIT

About

unofficial nepse sdk that actually works

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages