How onjin/runenv works
Main Components
a) Core Components:
• Environment File Parser
• CLI Interface
• Python API
• Environment Manager
• File System Interface
b) Integration Points:
• External Applications
• Python Web Frameworks
• Operating System Environment
┌─ Application Layer ─────────────────────┐
• External Apps / Web Frameworks │
• ┬────────────────────┘
• ↓
┌─ Interface Layer ─────────────────────────────────────┐
• ┌─────────────┐ ┌──────────────┐ │
• CLI Tool │ │ Python API │ │
• ┬──────┘ └───────┬──────┘ │
• ┼───────────────────────────┼─────────────────┘
┌────────▼───────────────────────────▼─────────────────┐
• Core Processing Layer │
• ┌─────────────────────┐ ┌────────────────────┐ │
• Environment Manager │◄──►│ Environment Parser │ │
• ┘ └────────────────────┘ │
• ┬────────────────┘
┌───────────────────────────────────▼────────────────┐
• Storage Layer │
• ┌──────────────┐ ┌───────────────────────────┐ │
• .env File │◄──►│ Operating System ENV Vars │ │
• ┘ └───────────────────────────┘ │
• ┘
Component Details
a) Interface Layer:
• CLI Tool: Handles command-line operations (runenv command)
• Python API: Provides load_env and create_env functions
b) Core Processing:
• Environment Manager: Handles variable loading, prefixing, and stripping
• Environment Parser: Processes .env file syntax and variable interpolation
c) Storage Layer:
• File System Interface: Handles .env file reading
• OS Environment Interface: Manages system environment variables
Key Interactions to Highlight
• File search patterns (parent directory traversal)
• Variable prefix handling
• Environment variable interpolation
• Framework integration points
Implementation Details
• src/runenv/ as the core implementation
• tests/ for testing infrastructure
• Support for various .env file formats