Skip to main content

NEPSE API Wrapper

This python module fetches the data from Nepali Stock Site and provides them in a pythonic and usable way.

About

This is a API wrapper for NEPSE API. This project was inspired from PyPi Nepse.

Documentation

There is a detailed guide in my documentation page for getting started and installing. Documentation

How to use?

You can use this by package from Nepse API PyPi

pip install nepse-api

Why use this?

How is this better than PyPi Nepse?

  • It is asynchronous.
  • Data can be taken as attributes rather than from dict.
  • Data is fetched from the API rather than scraping the site.
  • Data is cached

APIs used

The APIs that I used to create this API wrapper is:

How to use?

import asyncio
import httpx
from nepse import Client


async def main():
    company_Symbol = input('Input Company Symbol (Uppercase): ')

    # Doing this is optional you can directly
    # Initialize using `client = Client()` as well
    async with httpx.AsyncClient() as async_client:
        # Initializes the client
        client = Client(httpx_client=async_client)

        # Gets the data
        data = await client.security_client.get_company(symbol=f"{company_Symbol}")

        # Prints the highest price for that company today
        print(f'High Price of {company_Symbol}: ', data.high_price)
        print(f'Low price of {company_Symbol}: ', data.low_price)
        print(f'Open Price of {company_Symbol}: ', data.open_price)

# Run the function
loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Why are the attributes so in-costistent?

The attribues are in-consistent because the attributes are set according to the response set by the API. I tried changing it up but that would be distruptive because the comability with the API would be broken.

Want To Contribute?

You can send a pull request or open an issue to contribute. Check out Code Of Conduct before contributing.

Release files for nepse-api 1.1.12

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

Source distribution (sdist)

Source distribution for nepse-api 1.1.12
File Size Uploaded
nepse-api-1.1.12.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nepse-api 1.1.12
File Interpreter ABI Platform
nepse_api-1.1.12-py3-none-any.whl Python 3 none any Details

Total release size: 25.7 kB

Release files / nepse-api-1.1.12.tar.gz

Download URL nepse-api-1.1.12.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3bf1b86ab7d6892c0194f3279e611ba302c7b9c28d969961f21ecb30963d192a
BLAKE2b-256 checksum
How to use checksums
f08d680baaf0542be7e2abe3b8f7820531f3b9ec2a12d2010b308900bad9d63c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.6 CPython/3.9.5 Linux/5.12.14-arch1-1

Release files / nepse_api-1.1.12-py3-none-any.whl

Download URL nepse_api-1.1.12-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8b3caeaff6fd8ab1c7f28306206edc6f6f762f479e804cfe6bf80062d6bb32c
BLAKE2b-256 checksum
How to use checksums
cf929f9f1457434f91e9938aa4c2bb533087724c28b25c48deb667a0e85f17ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.6 CPython/3.9.5 Linux/5.12.14-arch1-1

Release history Release notifications | RSS feed

This release

1.1.12 This release

2 release files

1.1.11

2 release files

1.1.10

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4

2 release files

0.3.1

2 release files

0.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2

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