examples of how to hide api keys, examples using python import, json, yaml and environmental variables
Note: my example has the config files commented out so I can include them here. Would be ignored in real usage.
This example assumes the script and json files with the keys and/or tokens are all in the same directory.
config.py <- these are the config files that hold the api keys or tokens
config.json
config.yml
config.py
__init__.py
__pycache__
.ipynb_checkpoints
Untitled*.ipynb
api_security.ipynb <- jupyter notebook with examples
- How to Hide Your API keys with Python: https://medium.com/black-tech-diva/hide-your-api-keys-7635e181a06c
- How to Hide an API Key with Python: https://rapidapi.com/blog/how-to-hide-an-api-key-with-python/
- Configuration Files in Python: https://martin-thoma.com/configuration-files-in-python/
- How to Hide Your API Keys in Python: https://towardsdatascience.com/how-to-hide-your-api-keys-in-python-fb2e1a61b0a0