I have been doing courses for algorithmic trading this week and, as you to connect to an API, it is required to use an API Token together with the API URL.
The project works good, everything is ok. Nevertheless, I have seen that if you upload an archive and you call it secrets.py, the archive is hidden for the public on GitHub (I´m not sure about this but there should be a way to hide it).
The point is that I need to hide the API Token somewhere in the folder and them upload it, but when you call it secrets.py, what happens is that while calling it such as:
from secrets import API_Token
being API Token:
API_Token = 'stringthataccesstheAPI'
I expected to do all the imports properly but they threw an error due to their internal Script called secrets.py. It does not allow me to import the usual packages as the have the secrets.py file too.
For example, if I do the import above, and then bring this packages:
import numpy as np
import pandas as pd
Neither will be imported to the Notebook, because that file is already in the packages.
My solution has been to import the file changing it´s name to api_secrets.py and then, it works, but I don´t know how it will be hidden in GitHub, or how it will work if someone downloads it. This are my first projects with APIs so maybe I haven´t explained something well.
Thanks for the feedback.