[feature] #2: validação chave API

implementação da função 'aux.validarChaveAPI()'
This commit is contained in:
2024-08-22 21:33:40 +01:00
parent 228eb47f0b
commit a9225be586

View File

@ -9,8 +9,12 @@ import mplfinance as mpf
# a chave da API 'CHAVE_API_DEMO'
if not os.path.exists('modulos/constantes.py'):
chave_api = input('Introduza a chave da API Demo de CoinGecko: ')
with open('modulos/constantes.py', 'w') as f:
f.write(f'CHAVE_API_DEMO = \'{chave_api}\'\n')
if (not aux.validarChaveAPI(chave_api)):
print(f'erro na validação da chave API {chave_api}')
quit()
else:
with open('modulos/constantes.py', 'w') as f:
f.write(f'CHAVE_API_DEMO = \'{chave_api}\'\n')
import modulos.coingecko_api as cgapi