Skip to main content

Complete NepalStock solution in command line

Project description

NEPSENSE

Complete NEPSE solution in command line

https://user-images.githubusercontent.com/52292457/123103383-a924c500-d455-11eb-94a4-b1fde8ff8c48.mp4

Installation

pip install nepsense

After the installation you can use the cli application with the priceof command

Usage

usage: priceof [-h] [-c  [...]] [-f [path ...]] [-n] [-s] [-m symbol] [-ms] [-d] [-cu] [-ci] [--losers] [--gainers]
[--supply] [--demand] [--turnover] [--volume] [--transactions]

STONK, complete NEPSE solution in command line

optional arguments:
  -h, --help            show this help message and exit
  -c  [ ...], --company  [ ...]
                        symbols of companies seperated by space
  -f [path ...], --floorsheet [path ...]
                        Saves today's floorsheet as a csv file You can specify the path as argument. if no argument 
                        is provided the csv file will be saved in the current directory
  -n, --nepse           get NEPSE index
  -s, --sub-indices     get subindices
  -m symbol, --market_depth symbol
                        get market depth of a company
  -ms, --market_summary
                        get market summary
  -d , --get_detail     get the non price related detail of the company
  -cu , --custom        custom list in data.py
  -ci , --change_index 
                        change the value of id sent as a payload in the post request
  --losers              get the top losers
  --gainers             get the top gainers
  --supply              get the scripts with maximum supply
  --demand              get the scripts with maximum demand
  --turnover            get the scripts with maximum turnover
  --volume              get the scripts with maximum volume
  --transactions        get the scripts with maximum transactions

Please change the index with -ci flag.

If you get this type of message when using the cli. Review the following video

https://user-images.githubusercontent.com/52292457/123106754-a1b2eb00-d458-11eb-924c-591f24bcb4e2.mp4

Since i can't afford to pay for the nepse api(I don't think I would, even if I could, but anyways). There are some caveats to retrieving data from api endpoints from the nepse's newweb website. Nepse decided to change the request method for some api endpoints from get to post. The payload sent along with the post request changes randomly at different intervals. The payload looks like

{
  "id" : 123
}

Here 123 is a random number. This number can be changed using the -ci flag. To get the id we have to inspect the network traffic while loading the nepse's newweb website. This is demonstrated in the video above

Floorsheet

priceof -f [path]

You can either specify a path or leave it blank. If you leave it blank the floorsheet csv file will be saved in you current directory. The floorsheet file will be saved as floorsheet_todaysdata_weekday.csv You can do different kind of analysis on the data using the floorsheet.ipynb notebook.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nepsense-0.69.420.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

nepsense-0.69.420-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file nepsense-0.69.420.tar.gz.

File metadata

  • Download URL: nepsense-0.69.420.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.2

File hashes

Hashes for nepsense-0.69.420.tar.gz
Algorithm Hash digest
SHA256 baeaab36551de3a704d3960c8d9676de0bd1dd7511f82a9aef846dcb084241a2
MD5 559b4ad52fce17b30cf9f5c1c55877cb
BLAKE2b-256 bdf2fd8e5fe396cf99be0c921f61dd80ea511e1a8e277af0ba69a0deda4c77e1

See more details on using hashes here.

File details

Details for the file nepsense-0.69.420-py3-none-any.whl.

File metadata

  • Download URL: nepsense-0.69.420-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.2

File hashes

Hashes for nepsense-0.69.420-py3-none-any.whl
Algorithm Hash digest
SHA256 80968ced19358d7123c36079401ffd649526c28f418a285fce12ed2341cc261b
MD5 1a91d7a376635c3d58a3b3a179b418c3
BLAKE2b-256 938f2c9d0fda75aed8917f32730ebb01365a4ddb307de1ed4351141e2f9857db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page