Questions tagged [nsepy]

A Python Library to get publicly available data on National Stock Exchange of India (NSE) website.

About NSEpy

From the NSEpy documentation:

NSEpy is a library to extract historical and realtime data from NSE’s website. This Library aims to keep the API very simple.

Python is a great tool for data analysis along with the scipy stack and the main objective of NSEpy is to provide analysis ready data-series for use with scipy stack. NSEpy can seamlessly integrate with Technical Analysis library (Acronymed TA-Lib, includes 200 indicators like MACD, RSI). This library would serve as a basic building block for automatic/semi-automatic algorithm trading systems or backtesting systems for Indian markets.

Latest stable release:

NSEpy 0.6 - 10 March 2018

Resources

Official Resources

34 questions
8
votes
3 answers

Map to List error: Series object not callable

from nsepy import get_history from datetime import date import datetime import pandas as pd import numpy as np file = r'C:\Users\Raspberry-Pi\Desktop\Desktop\List.xlsx' list = pd.read_excel(file) list = list['SYMBOL'] start =…
Quantum Dreamer
  • 432
  • 1
  • 6
  • 17
2
votes
1 answer

I want to list out the companies in NSE indices

I am using NSEPY API and I would like to list out the stocks which are included in nifty 50 indice. I am getting history data for the individual stocks but not getting nifty 50 stocks (totally 50 stocks). I want to retrieve it . import nsepy from…
Kavikayal
  • 143
  • 4
  • 14
2
votes
1 answer

joining two dataframes with same columns but gives me ValueError: columns overlap but no suffix specified

I'm getting errors from my input function: from nsepy import get_history data1 = get_history(symbol='TATAMOTORS', start=date(2018,1,1),end=date(2018,6,7)) data2 = get_history(symbol='ALSEC', start=date(2018,1,1),…
Pratik
  • 21
  • 1
  • 3
1
vote
0 answers

Not able to import data through nsepy

I am trying to import the nsepy library to get the data of state bank of india stock (SBIN) for the year 2018, but get an error. Code: from nsepy import get_history import datetime as dt sbi_df =…
1
vote
1 answer

Showing Empty DataFrame as output

This is my code. I tried to concatenate the data but it is showing the empty dataframe. I want the details of symbols provided in the list as output which will be in the form of dataframe. import pandas as pd from nsepy import get_history from…
1
vote
0 answers

How to get the list for nsepy package index naming conventions

data = get_history(symbol="NIFTY BANK", start=from_date, end=to_date,index=True, option_type = 'CE', strike_price = 38000, expiry_date = dt.date(2021, 10, 7)) Using the above code but getting returned blank dataframe.
1
vote
2 answers

Filter date index based on regex in pandas

I have date column with price index like below, Date Price 2010-01-01 23 2010-12-31 25 2013-02-03 24 2013-12-31 28 2016-03-04 27 2016-12-31 28 2018-01-01 31 2020-01-01 30 2020-12-31 20 I want to extract dates which ends…
Krish1992
  • 81
  • 8
1
vote
1 answer

Getting empty dataframe for most of the stock using nsepy

I am trying to fetch nse stock data but i am unable to do so as whenever I try to do so I get empty dataframe with this code even after trying to upgrade the nsepy from nsepy import get_history from datetime import…
user7826397
  • 21
  • 1
  • 6
1
vote
2 answers

Web scraping in python not loading the data

I am trying to get data from NSE website using the below python code and i am getting [-] insted of [266] the data 266 is not loading please…
Benson
  • 27
  • 1
  • 7
1
vote
1 answer

NSEpy giving ValueError: Please check start and end dates when trying to retrieve historical stock information

I am trying to retrieve historical stock information using NSEpy but I am unable to do so because it raises a ValueError everytime I pass a date to it and I cannot seem to figure out the problem and would appreciate any help. This is my code: from…
T3DS
  • 31
  • 5
1
vote
0 answers

nsepy returns empty dataframe

nsepy get_history is returning an empty dataframe. What could be the reason for this? I am using version 0.7(latest version) from datetime import date,timedelta from nsepy import * end_day = date.today() start_day = end_day -…
1
vote
1 answer

NSEPY get_history() function not working for currencies

Why is my data frame empty? If I execute the get_history() function for stocks like SBIN, the code works. But it doesn't work for currency derivatives like USDINR. pip install nsepy from nsepy import get_history from datetime import date import…
1
vote
1 answer

nested for loop dictionary store values python nsepy

startdate = datetime.date(2018,1,1) expirydate = datetime.date(2018,1,4) data = dict() for x in range(0,3): for y in range(1,8): data [y] = get_history(symbol="BANKNIFTY", start= startdate, …
1
vote
0 answers

How to pass multiple strike prices or range of strike prices when downloading data with nsepy in python

I want to download the data in one go for multiple strike prices. Below function works as expected but for single strike price. def download_nifty_option_data(self): expiry_date_prev_month = get_expiry_date(year=2018, month=11) #Adding one…
Devesh Agrawal
  • 8,982
  • 16
  • 82
  • 131
1
vote
1 answer

How to adjust Moving Average for weekly analysis?

I need to plot moving average on the basis of weekly intervals like 3 week interval or 21 days, but while adjusting for the missed dates it now counts 0 and thus it gives incorrect result. from nsepy import get_history as gh from datetime import…
VishalQuery
  • 109
  • 8
1
2 3