It looks like you're new here. If you want to get involved, click one of these buttons!
from kiteconnect import KiteConnect
import os
from nsepy import get_history
import datetime as dt
import pandas as pd
cwd = os.chdir("C:/Users/Administrator/Desktop/Zerodha")
#generate trading session
access_token = open("access_token.txt",'r').read()
key_secret = open("credentials.txt",'r').read().split()
kite = KiteConnect(api_key=key_secret[0])
kite.set_access_token(access_token)
vfrom = "2018-01-03 1"
vto = "2018-01-05"
ohlc = kite.historical_data('SNOWMAN','vfrom','vto','30minute')
from kiteconnect import KiteConnect
from kiteconnect import KiteTicker
import os
import datetime as dt
import pandas as pd
api_k = "XXXXXXXXXXXXXX" #enter your api_key
api_s = "XXXXXXXXXXXXXX" #enter your api_secret
def get_login(api_k, api_s): # log in to zerodha API panel
global kws, kite
kite = KiteConnect(api_key=api_k)
print("[*] Generate access Token : ", kite.login_url())
request_tkn = input("[*] Enter Your Request Token Here : ")
data = kite.generate_session(request_tkn, api_secret=api_s)
kite.set_access_token(data["access_token"])
kws = KiteTicker(api_k, data["access_token"])
# print(data['access_token'])
get_login(api_k, api_s)
vfrom = "2020-08-05"
vto = "2020-12-10"
ohlc = kite.historical_data(12053506,vfrom,vto,'30minute')
print(ohlc)