This is a API wrapper for NEPSE API.
Project description
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():
# 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="UPPER")
# Prints the highest price for that company today
print(data.high_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.
Documentation?
Documentation is still in progress!
Want To Contribute?
You can send a pull request or open an issue to contribute.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for nepse_api-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3293eb2c19544c651063713c8e8b30fc8a629de5259a92e9fb47ab14c4009ae |
|
MD5 | 965bffb07624634961a9deaa0b2388e2 |
|
BLAKE2b-256 | 27c9664ace791de4e38005a45acd04c8caecfb6bb97547a568a051d6856c2ad1 |