cd nepse-cli
pip install -r ./requirements.txt
pip3 install -r ./requirements.txt
Or, if you don't 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
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.
This command has three options: --live, --status, --percent-change. All these options will require one argument either be 1 or True. This just tells the program that we only need that particular information.
If you want to check weather the market is open or not, you can use the following command.
python3 nepse.py nepse --status True
To check the percentage change in the NEPSE Index, you can use the following command:
python3 nepse.py nepse --percent-change 1
python3 nepse.py company-profile adbl
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
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. For example,
python3 nepse.py price nabil
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.
python3 nepse.py news
If you want to extract certain amount of news,
python3 nepse.py news --n 10
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.
python3 nepse.py top gainer
This will print the top 5 gainers.
python3 nepse.py top looser
python3 nepse.py top turnover
If you want to print a certain number of top scrips, you can use the option --n.
For example,
python3 nepse.py top gainer --n 10
This command will print the top 10 gainers of the latest trading day.
Remember that the max value for --n is 10. So, app will throw an exception of list out of range
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.
python3 nepse.py index {index_name}
The possible indices are: Banking, Tourism, Hotels, Devbanks, Hydropower, Finance, NonLifeInsu, Manufacture, Others, Microfinance, LifeInsu, Investment
For example, if you want to see the data of the trading development bank index, you can use the following commnad.
python3 nepse.py index devbanks
For help regarding this command, type:
python3 nepse.py index --help
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.
python3 ./api/nepse_api.py
This will serve on the 127.0.0.1 port 3322.
http://127.0.0.1:3322
https://127.0.0.1:3322/companies