Cross-platform environment variable management without system pollution.
pip install --user hedgebuddyimport hedgebuddy
# Required variable (raises error if missing)
api_key = hedgebuddy.var("API_KEY")
# Optional with fallback
api_url = hedgebuddy.var("API_URL", "https://api.example.com")
# Optional (None if missing)
email = hedgebuddy.var("REPORT_EMAIL", None)hedgebuddy.var(name, default=...) # Get variable
hedgebuddy.exists(name) # Check if exists
hedgebuddy.all_vars() # Get all as dict
hedgebuddy.inject_env() # Inject into os.environhedgebuddy.enable_logging() # Enable daily log files
print("This is logged!") # Captured automatically
hedgebuddy.log("Message") # Log directly
hedgebuddy.log_error("Error")
hedgebuddy.log_warning("Warning")Log Location: %APPDATA%\hedgebuddy\logs\ (Windows) · ~/Library/Application Support/hedgebuddy/logs/ (macOS)
hedgebuddy.VariableNotFoundError # Variable missing (no default)
hedgebuddy.StorageNotFoundError # active profile vars.json not found
hedgebuddy.StorageCorruptedError # Invalid JSON- Windows:
%APPDATA%\HedgeBuddy\profiles\<active>\vars.json - macOS:
~/Library/Application Support/HedgeBuddy/profiles/<active>/vars.json
The library resolves the active profile from profiles.json automatically.
Download from Releases to manage variables with a GUI.
MIT License