Giter Club home page Giter Club logo

nepse-api's Introduction

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.

nepse-api's People

Contributors

caffeineduck avatar thenishantsapkota avatar awebisam avatar aashu-kattel avatar asachit avatar entalecia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.