How to Manage Environment Variables in .env Files in Python like a Pro

Опубликовано: 29 Октябрь 2024
на канале: Coding Together
95
3

Hello Pythoneers 🧑🏽‍💻

In this video we’re diving into the world of environment variables using the dotenv module. Are you ready to streamline your project setup?

If you want to handle variables like a pro, you’re in the right place! We’ll start with the basic setup and then explore the various files I’ve created to help you manage your environment variables efficiently.

Whether you're a terminal enthusiast or prefer working in a script, I’ve got you covered.

⏰ Content
-----------------------------------------------------------------------------
0:00 Intro
0:32 Basics
2:33 "python-dotenv[cli]"
4:57 dotenv_values
6:08 stream
6:51 override
7:37 dotenv in IPython
8:16 advanced config

🎥 Related Videos of Mine
-----------------------------------------------------------------------------
⭐ How to use OpenAI API for Image to Text - with GPT4o
   • How to use Open AI API in Python - Im...  

🔗 Links
-----------------------------------------------------------------------------
🔗 GitHub
https://github.com/Tonkyboy/python-do...

🔗 Documentation
https://pypi.org/project/python-dotenv/

💲 Commands
-----------------------------------------------------------------------------
pip install python-dotenv
pip install "python-dotenv[cli]"
dotenv set MAIN_USER foo
dotenv -f .secrets.env set KEY 123456
dotenv list
dotenv -f .secrets.env list
dotenv list --format=json
dotenv --help
dotenv run -- python python-dotenv.py
%load_ext dotenv
%dotenv
%dotenv your/path/.env

#environmentvariables #environment #programming #coding #python