NSEpy Library to Extract Historical Data from NSE’s Website

from nsepy import get_history
from datetime import datetime
import dateutil.relativedelta
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
to_date=datetime.now()
to_date=datetime.strftime(to_date,'%Y,%m,%d')
to_date=datetime.strptime(to_date,'%Y,%m,%d')
from_date=to_date-dateutil.relativedelta.relativedelta(month=1)
data=get_history(symbol='RELIANCE',start=from_date,end=to_date)
print(data)
data['Close'].plot()
plt.show()