Skip to content

ankurgajurel/nepse-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Change into the git directory

cd nepse-cli

Install the required dependencies

For Windows,

pip install -r ./requirements.txt

For Linux / UNIX,

pip3 install -r ./requirements.txt

Or, if you do not want the hassle, you can also run the req.py file. This will install the dependencies for you.

python3 req.py

For help, use the command:

python3 nepse.py --help

Usage of 'nepse' command

python3 nepse.py nepse 

This command will get you the recent data about the NEPSE Index. For example, the above command will return the latest index of the market.

Options

Options:
    --live [True / False / 1 / 0]: Live NEPSE Index
    --status [True / False / 1 / 0]: Market Open or Closed
    --percent-change: Percentage Change in NEPSE Index

Usage of 'all-scrips' command

This will print out all the scrips

python3 nepse.py all-scrips

Usage of 'company-profile' command

python3 nepse.py company-profile [script]

This command will print the company profile of the scrip "ADBL". The company profile at the moment only includes the full name of the company and the type of the scrip, if it is a stock or a mutual fund or a debenture, etc

Usage of 'price' command

python3 nepse.py price [scrip]

The price command will give return you the Last Transaction Price, Percentage Change in the price, highest price for that transaction day and lowest price for that transaction day. The command will only take one argument which is the scrip symbol of the desired company.

Usage of 'news' command

python3 nepse.py news

You can also extract the latest breaking news related to NEPSE. There might not be many news beacuse this command will extract only important ones.

Options

Base:

python3 nepse.py news [option]

--options

    --n [int]: Prints out specific number of news.

Usage of 'top' command

python3 nepse.py top [options]

You can also view the top gainers, loosers and the top turnover using the "top" command. The top command has one required argument. The argument might either be "gainer" or "looser" or "turnover". It will print a tuple of the symbol and the value of the property.

Options

    gainer: Prints out the top gainer companies of the day
    looser: Prints out the top loser companies of the day
    turnover: Prints out the top turnover companies of the day

--multi-option Base:

python3 nepse.py top [option1] [option2]

Option2s:

    --n [int]: specific number of companies in the top

Usage of 'index' command

python3 nepse.py index [options]

You can check the data of every index like total gainers, losers of that index, value of that index, percent change of that index from the index command.

Options

    Banking, 
    Tourism, 
    Hotels, 
    Devbanks, 
    Hydropower, 
    Finance, 
    NonLifeInsu, 
    Manufacture, 
    Others, 
    Microfinance, 
    LifeInsu, 
    Investment

Note: the index options are not case sensitive.

NEPSE_API FLASK

I have also started developing a flask api for the data I am using for this app. To use the API, follow these steps. Note: You should have already setup the app and installed the required dependencies as mentioned in the top of this README.

Run the Flask App

python3 ./api/nepse_api.py 

This will serve on the 127.0.0.1 port 3322.

Open the browser and go to this URL

http://127.0.0.1:3322

Company Names

https://127.0.0.1:3322/companies

Scrip Data

https://127.0.0:3322/scrip/<scrip_name>

For example, if we want script data for ADBL, the url should look like:

https://127.0.0.1:3322/scrip/adbl

Contributing

If you're willing to contribute to this project, please go through the project yourself or contact me on any of my socials and I'll expalin all about the project to you. The projet is fairly simple and anyone with basic understanding of Python, APIs and CLIs can contribute.