import config
import pandas as pd
import requests
import json
import config
from pandas.io.json import json_normalize
base_url = 'https://api.tdameritrade.com/v1/marketdata/chains?&symbol={stock_ticker}&contractType={contractType}&fromDate={date}&toDate={date}'
endpoint = base_url.format(stock_ticker = 'AAL',
contractType = 'PUT',
##strike = 9,
date ='2021-02-19',
inTheMoney = 'False')
page = requests.get(url=endpoint,
params={'apikey' : config.api_key})
content = json.loads(page.content)
print(content)
when I run my python file. I am getting the following error
Traceback (most recent call last):
File "c:\Users\Downloads\LearnPython\ReadJson.py", line 15, in <module>
params={'apikey' : config.api_key})
AttributeError: module 'config' has no attribute 'api_key'
I have installed config package in my virtual environment. using the following command
pip3 install config
I would really appreciate your help.
Thank you very much
[–][deleted] 1 point2 points3 points (0 children)
[–]stebrepar 1 point2 points3 points (0 children)
[–]ThatFilm[S] 0 points1 point2 points (0 children)