Hide API keys in Python scripts using python-dotenv, .env, and .gitignore

Published: 27 June 2021
on channel: Jonathan Soma
50,458
1.2k

Sometimes you want to make your code public, but don't want to share an API key, email address, or password with the world. Using a combination of python-dotenv and a .gitignore file, you'll be good to go!

Note: If you're using Jupyter Notebooks, make sure you're not printing your API keys all over the place!! (and also: your .env file will need to be in the same directory as your .ipynb)

repo: https://github.com/jsoma/dotenv-example
python-dotenv: https://github.com/theskumar/python-d...
gitignore: https://gitignore.io/


On this page of the site you can watch the video online Hide API keys in Python scripts using python-dotenv, .env, and .gitignore with a duration of hours minute second in good quality, which was uploaded by the user Jonathan Soma 27 June 2021, share the link with friends and acquaintances, this video has already been watched 50,458 times on youtube and it was liked by 1.2 thousand viewers. Enjoy your viewing!