Skip to main content

Simple, beginner-friendly Python environment variable loader with Flask & Django support

Project description

as_envhelper

A simple, powerful, and beginner-friendly environment variable loader for Python.
Read key-value pairs from a .env file and set them as environment variables.
Built by ASWIN KUMAR K.


🚀 Installation

pip install as_envhelper

⚡ Usage

Basic usage

from as_envhelper import load_env, get_env

# Load variables from a .env file
load_env(".env")

# Access a variable
db_user = get_env("DB_USER")
print("Database User:", db_user)

Get all environment variables as a dictionary

from as_envhelper import env_to_dict

env_dict = env_to_dict()
print(env_dict)

🐍 Flask Integration

from flask import Flask
from as_envhelper import apply_to_flask

app = Flask(__name__)

# Load .env variables and apply to Flask config
apply_to_flask(app, ".env")

print(app.config["DB_USER"])

🐍 Django Integration

# In your Django settings.py
from as_envhelper import apply_to_django_settings
import sys

# Apply .env variables to Django settings module
apply_to_django_settings(sys.modules[__name__], ".env")

print(DB_USER)

✨ Features

  • Easy .env file loading
  • Safe variable access with optional type casting and validation
  • Enterprise-ready (regex, numeric ranges, choices)
  • Multiline and nested variable support (basic)
  • Flask and Django integration
  • Works on all major OS

⚠️ Limitations

  • Advanced multiline parsing may be limited
  • Direct overwrite of OS environment variables if same keys exist
  • Users must manually create .env files
  • Less community adoption initially (new library)

👨‍💻 Author

ASWIN KUMAR K
Email: aswinkumar06k@gmail.com
GitHub: https://github.com/Aswin-Kumar24072003/as_envhelper


📄 License

GPLv3 – See LICENSE file for details


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

as_envhelper-1.0.3.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

as_envhelper-1.0.3-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file as_envhelper-1.0.3.tar.gz.

File metadata

  • Download URL: as_envhelper-1.0.3.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for as_envhelper-1.0.3.tar.gz
Algorithm Hash digest
SHA256 93f3c821f35677974aa24a1a0e323bbfbcf53f67f5c6b992cb57f04f944f8ee2
MD5 059f37cec23d5925e4db9309330bf02d
BLAKE2b-256 67c29c4d7758b9218830bb1f09d7a8ed846a2de30500cb2bd612f572c955dca5

See more details on using hashes here.

File details

Details for the file as_envhelper-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: as_envhelper-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for as_envhelper-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7adab4a8956a6cfabe2a93761184714176d9defcc50969ec5e7d8ed7d4056f9a
MD5 b5d2405c65420ddb7cf8655bf7040489
BLAKE2b-256 521e8d75c5fe236af072a6a1f4da4a1da6c0599b4511eeb94044f9e27c07b0d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page