Repository navigation
v0.2.0 - Initial public release: Near-100% python-dotenv Compatibility
[0.2.0] - 2026-01-05
Features
- Variable expansion with
${VAR}and$VARsyntax - Two-pass parsing: parse lines first, then expand variables
- System environment fallback for undefined variables
- Multiline values (quoted strings spanning multiple lines)
- Proper quote state tracking across line boundaries
- Escape sequences in quoted strings:
\n,\t,\\,\",\' - Inline comment handling with quote-awareness
- Export prefix support (
export KEY=valuestripped automatically) - Keys without
=return empty string (Mojo Dict limitation) - Verbose mode on all APIs (
verbose: Boolparameter) find_dotenv()function for automatic .env discovery (up to 20 parent directories)
Bug Fixes:
- Fixed multiline quote detection to properly handle escaped backslashes (e.g.,
\\\\before closing quote) - Consecutive backslash counting ensures correct quote escape detection
Testing:
- 8 comprehensive test files covering all features
- test_export.mojo - export prefix handling
- test_escapes.mojo - escape sequence processing
- test_variables.mojo - variable expansion
- test_multiline.mojo - multiline value parsing
- test_phase3plus.mojo - find_dotenv(), inline comments, verbose mode
- Dynamic test-all task runs all test_*.mojo files automatically
Compatibility:
- 98%+ feature parity with python-dotenv
- All Phase 3+ features implemented
- Near-100% compatibility achieved
Known Differences from python-dotenv
- Keys without
=: Returns""instead ofNone(Mojo Dict limitation documented) - Stream input: Not supported (file paths only)
- Encoding parameter: UTF-8 only (Mojo default)