Releases: DataBooth/mojo-dotenv
Releases · DataBooth/mojo-dotenv
v0.2.1 - Improved Error Handling
Package Files
dotenv.mojopkg - Compiled with Mojo 0.26.1.0.dev2026010517 (9d7cb35f)
.mojopkg file is compiled with the Mojo version shown above. It may not work with different Mojo versions. For maximum compatibility, use source installation (git submodule or direct copy).
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)