{"library":"poetry-dotenv-plugin","title":"Poetry Dotenv Plugin","description":"A Poetry plugin that automatically loads environment variables from `.env` files into the environment before Poetry commands are run. It is currently at version 0.2.0 and provides an essential feature for managing project-specific configurations by integrating seamlessly with Poetry's workflow.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":[],"cli":{"name":"poetry","version":null}},"imports":["This is a Poetry plugin and is not imported directly into Python code. Its functionality is activated automatically by Poetry."],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# 1. Install the plugin (if not already installed)\n# poetry self add poetry-dotenv-plugin\n\n# 2. Create a .env file in your project root\n# echo 'MY_SECRET_KEY=\"supersecret\"' > .env\n# echo 'DATABASE_URL=\"postgresql://user:password@host:port/dbname\"' >> .env\n\n# 3. Create a Python script (e.g., main.py)\n# print('import os\\n\\nif __name__ == \"__main__\":\\n    print(f\"My secret key: {os.environ.get(\\'MY_SECRET_KEY\\', \\'NOT_SET\\')}\")\\n    print(f\"Database URL: {os.environ.get(\\'DATABASE_URL\\', \\'NOT_SET\\')}\")') > main.py\n\n# 4. Run the Python script via Poetry\npoetry run python main.py","lang":"bash","description":"This quickstart demonstrates how to install the `poetry-dotenv-plugin`, define environment variables in a `.env` file, and then access them within a Python script executed using `poetry run`. The plugin automatically loads the variables without explicit code changes.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}