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():
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.
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
File details
Details for the file nepse-api-1.1.9.tar.gz
.
File metadata
- Download URL: nepse-api-1.1.9.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.9.5 Linux/5.12.14-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4a0e4a4b9195006bb58880c68fbfffbbdaa2b62494340439f37de21183858a9 |
|
MD5 | c9b16436544b6a91b3f0805803248fad |
|
BLAKE2b-256 | 2d9190889f39523f2b8b850ab2e81dbf084c6ddd01ba92864e321479befdc9ff |
File details
Details for the file nepse_api-1.1.9-py3-none-any.whl
.
File metadata
- Download URL: nepse_api-1.1.9-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.9.5 Linux/5.12.14-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9424c82eda3327ccaf5f61b0b358a5a5e1d55f645823de759a5101fa57d529dd |
|
MD5 | 35b0d54af5929e9695c9a5922f4214eb |
|
BLAKE2b-256 | 07f5e2727e6a47dfd8d2de06fa89758be2c9c5d93b57023399101fe9d7484129 |