Metadata-Version: 2.1
Name: nepse-api
Version: 1.1.10
Summary: This is a API wrapper for NEPSE API.
Home-page: https://github.com/Samrid-Pandit/nepse-api/
License: MIT
Author: Samrid Pandit
Author-email: samrid.pandit@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: attrs (>=21.2.0,<22.0.0)
Requires-Dist: cachetools (>=4.2.2,<5.0.0)
Requires-Dist: httpx (>=0.18.1,<0.19.0)
Requires-Dist: pyhumps (>=3.0.2,<4.0.0)
Project-URL: Repository, https://github.com/Samrid-Pandit/nepse-api/
Description-Content-Type: text/markdown

# NEPSE API Wrapper

This python module fetches the data from [Nepali Stock Site](https://newweb.nepalstock.com/) 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](https://github.com/pyFrappe/nepse). 

## Documentation

There is a detailed guide in my documentation page for getting started and installing.
[Documentation](https://nepse-api.readthedocs.io/)

## How to use?

You can use this by package from [Nepse API PyPi](https://pypi.org/project/nepse-api/)
```sh
pip install nepse-api
```

## Why use this?

How is this better than [PyPi Nepse](https://github.com/pyFrappe/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:
- https://newweb.nepalstock.com/api/

## How to use?

```py
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](CODE_OF_CONDUCT.md) before contributing.

