A python script to fetch FNO stocks from NSE and write all stock options with IV greater than 50 to Gsheet.
Requirements:
Requests
pipenv install requests
Pandas
python3 -m pip install --upgrade pandas
Beautiful Soup
pip install beautifulsoup4
lxml
pip install lxml
Pygsheets -- thanks to @nithinmurali for this amazing tool
pip install pygsheets
*the documentation of the tool is kinda messed up. Read the documentation here : https://pygsheets.readthedocs.io/index.html
- Enable Sheets API and Drive API and download Service account credentials in a JSON file.
- Replace the
YOUR_CREDENTIAL_FILE_HERE.json
with the path to the json file you downloaded. - The files created by service account are not visible in your account. Replace
YOUR_EMAIL_HERE
with your Gmail id to be able to access the files.
sh.share('YOUR_EMAIL_HERE', role='writer', expirationTime=None, is_group=False)
- By default the sheet is publicly accesible, you can change it by commenting out this line
sh.share('anyone', role='reader', expirationTime=None, is_group=False)
*note : By doing this, only email-ids that you share the file with will be able to access the file.