cd nepse-cli
pip install -r ./requirements.txt
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
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:
--live [True / False / 1 / 0]: Live NEPSE Index
--status [True / False / 1 / 0]: Market Open or Closed
--percent-change: Percentage Change in NEPSE Index
This will print out all the scrips
python3 nepse.py all-scrips
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
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.
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.
Base:
python3 nepse.py news [option]
--options
--n [int]: Prints out specific number of news.
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.
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
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.
Banking,
Tourism,
Hotels,
Devbanks,
Hydropower,
Finance,
NonLifeInsu,
Manufacture,
Others,
Microfinance,
LifeInsu,
Investment
Note: the index options are not case sensitive.
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
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
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.