nepsepy
A clean Python interface for public Nepal Stock Exchange (NEPSE) market data.
nepsepy provides synchronous and async APIs for market status, prices, floor
sheets, indices, company information, notices, and other data used by the
NEPSE website.
It is not affiliated with the Nepal Stock Exchange.
Why nepsepy?
- Simple API — use named methods such as
today_price()andsecurity_profile()instead of manually assembling HTTP requests. - Public session handling — performs the same login-free bootstrap used by the NEPSE frontend; no user credentials are needed.
- Careful by default — requests are paced, token values are kept in memory, and rate limiting is surfaced clearly instead of retried aggressively.
Installation
Requires Python 3.10 or later.
python -m pip install nepsepy
The PyPI distribution and Python import package are both named nepsepy.
Quick start
from nepsepy import NepseClient
with NepseClient() as client:
status = client.market_status()
gainers = client.top_gainers()
prices = client.today_price(page=1, size=20)
print(status["isOpen"])
print(gainers[:3])
print(prices["content"][:3])
Most methods return the JSON object or list supplied by NEPSE. Pagination uses
1-based page numbers, matching the website UI. Dates use yyyy-MM-dd.
Full reference: https://nepsepy.readthedocs.io
Async use
For async applications such as FastAPI, use AsyncNepseClient. It has the
same endpoint methods and automatically manages the temporary NEPSE token.
from nepsepy import AsyncNepseClient
async def load_market():
async with AsyncNepseClient() as client:
status = await client.market_status()
gainers = await client.top_gainers()
return status, gainers
Features
| Area | Included data |
|---|---|
| Market | Status, summaries, live market data, ticker, and top-ten lists |
| Prices & trades | Today’s prices, floor sheets, depth, supply/demand, and trade history |
| Charts | NEPSE indices, index history, and market/company chart data |
| Companies | Profiles, corporate actions, financial reports, dividends, AGMs, and news |
| Directories | Companies, sectors, share groups, promoters, brokers, and dealers |
| News & files | Notices, disclosures, holidays, reports, events, CSV exports, and downloads |
Authentication and rate limits
No account credentials are required. NepseClient performs the same public
session bootstrap used by NEPSE’s frontend when it is first needed. Session
tokens stay in memory and are redacted from package diagnostics.
Requests are paced conservatively. A 429 Too Many Requests response raises
RateLimitedError; the client does not retry in a loop.
Common examples
from nepsepy import NepseClient
with NepseClient() as client:
# Use numeric security IDs; resolve them from companies() or securities().
companies = client.companies()
barun = next(row for row in companies if row["symbol"] == "BARUN")
profile = client.security_profile(barun["id"])
floorsheet = client.floorsheets(stock_id=barun["id"])
print(profile)
print(floorsheet["totalTrades"])
Interactive explorer
The repository includes a terminal explorer for local use:
python tui.py
Development
python -m pip install -e ".[dev]"
pytest -q
Scope and disclaimer
This package is for public, read-only market-data workflows. It does not handle user login, trading, portfolio actions, or other state-changing operations. NEPSE data may be delayed or corrected by the exchange; verify information independently before making financial decisions.
License
Distributed under the MIT License.
Metadata
Release files for nepsepy 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nepsepy-1.0.3.tar.gz | 25.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nepsepy-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 49.0 kB
Release files / nepsepy-1.0.3.tar.gz
| Download URL | nepsepy-1.0.3.tar.gz |
|---|---|
| Size | 25.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa391fcb9183cef40241c3ed23bf41db2e2f102579cda7235514f79fe5125324
|
|
BLAKE2b-256 checksum How to use checksums |
3e3a484f585f45b42d0d2935d1135d14e44c3bd60f9efd36c5d79a29446b8a42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logRelease files / nepsepy-1.0.3-py3-none-any.whl
| Download URL | nepsepy-1.0.3-py3-none-any.whl |
|---|---|
| Size | 23.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb1b2b0fa83d2d943772cde12d6df36877be65aa91e26568021b7831aedb78f6
|
|
BLAKE2b-256 checksum How to use checksums |
036959bf0b659a999bb1da99427e9f174f0dc5bfe570958d53d85aabe1918312
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency log