DataHungry Documents
  • Welcom to DataHungry Documents
  • Library
    • Apache Airflow
    • Apache Iceberge
    • Bardapi
    • Binance
    • Databricks
    • Datetime
    • dotenv
    • FastAPI
    • Logging
    • Langchain
    • Minio (S3)
    • MLflow
    • OpenCV
    • Optuna
    • os
    • Pyiceberg
    • Pyspark
    • Pytest
    • Schedule
    • Sklearn & SHAP
    • SQLAlchemy
    • transformers (huggingface)
    • Firebase Firestore
  • Course
    • Web Scraping
    • Streamlit
    • NLP
  • Utility
    • Docker
    • Google Sheet
  • SQL
    • Basic SQL Statements
    • PL/SQL
    • Stored Procedure & Function
  • Scala
    • Setup
    • Spark
  • Cloud
    • AWS
    • Google Cloud
Powered by GitBook
On this page
  • Install Package
  • Codes
  1. Library

dotenv

This package used to load environment from .env file

Install Package

pip install python-dotenv

Codes

.env
DB_URL=sqlite///mydb.db
app.py
from dotenv import load_dotenv
load_dotenv(override=True)

DATABASE_URL = os.getenv("DB_URL")
PreviousDatetimeNextFastAPI

Last updated 1 year ago