Skip to content

Instantly share code, notes, and snippets.

Last active August 14, 2023 21:43
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Reusable env related functions
import os
import sys
from awsglue.utils import getResolvedOptions
def load_env(environment):
if environment == "local":
from dotenv import load_dotenv
def get_env_or_args(env_name):
if os.environ.get(env_name):
return os.getenv(env_name)
return getResolvedOptions(sys.argv,[env_name])[env_name]
return ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment