简体   繁体   中英

Setting an API Key in google colab

I have been working in Python for a short time and know I am trying to use and API that needs a key. I have been given a key consisting in a bunch of numbers and letters. When I search through the internet in order to learn how to "implement" the key I just get opinion and tips but no one talks about how to do it itself. I am using Google Colab.

Could you help me or direct me to some place where it is explained, please?

Here you have the code that you can use directly in Colab:

!pip install eiapy
import os
os.environ['EIA_KEY'] = you_API

from eiapy import Series
cal_to_mex = Series('EBA.CISO-CFE.ID.H')
cal_to_mex.last(5)

The last 3 lines are taken from the example at this link . I tried it now and it works for me!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM