Skip to main content

nepsepy

nepsepy banner

PyPI Python PyPI Downloads Docs Tests License

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() and security_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.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nepsepy 1.0.4
File Size Uploaded
nepsepy-1.0.4.tar.gz 26.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nepsepy 1.0.4
File Interpreter ABI Platform
nepsepy-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 50.6 kB

Release files / nepsepy-1.0.4.tar.gz

Download URL nepsepy-1.0.4.tar.gz
Size 26.7 kB
Tags Source
SHA-256 checksum
How to use checksums
af6e23c9be4e5458eaf2238d5db278e67826528bd4e567ac9da0100dbc68059a
BLAKE2b-256 checksum
How to use checksums
eb37a6463da59ebeb60f979970591e81f20438b1a9f20a643e68c9543708e78c
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

Release files / nepsepy-1.0.4-py3-none-any.whl

Download URL nepsepy-1.0.4-py3-none-any.whl
Size 23.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eeff7dc1e108eaf82de6597cbb82c9011541ef7312bd36b5f195b39c83ca5734
BLAKE2b-256 checksum
How to use checksums
972c157655571e4e32c2fc3e62b26721dac7900a3bbf0c3f6ad502c004239b8e
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

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page