All notable changes to mojo-ini will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Bumped MAX / Mojo toolchain dependency to
max ">=26.1.0,<27"and updated recipes to pinmojo_version = "=0.26.1". - Updated the INI lexer to use
codepoint_slices()and a cachedList[String]buffer instead of directStringindexing, matching Mojo 0.26.1__getitem__semantics while preserving existing behaviour. - Adopted a "no warnings" policy for the core library and tests so future migrations surface only new issues.
Status: ✅ Production Ready
First stable release of mojo-ini! A native Mojo INI file parser and writer with Python configparser compatibility, featuring production-ready performance and comprehensive testing.
- Lexer (364 LOC): Complete tokenization with 7 token types (EOF, NEWLINE, COMMENT, SECTION, KEY, VALUE, EQUALS)
- Parser (171 LOC): Builds
Dict[String, Dict[String, String]]from tokens - Writer (142 LOC): Serializes Dict structures to INI format
- Public API (
__init__.mojo): Clean importsfrom ini import parse, to_ini, parse_file, write_file
- Section headers:
[section_name] - Key-value pairs with
=or:separators - Comments:
#(hash) and;(semicolon) styles - Inline comments after values
- Multiline values: Indented continuation lines (Python configparser compatible)
- Empty values and empty sections
- Special characters in values (URLs, paths, emails, Unicode)
- Default section (empty string key) for keys before any
[section]
parse_file(path): Read and parse INI fileswrite_file(path, data): Write Dict structures to INI files
- 46 tests across 5 test suites (100% passing)
- Lexer tests (9 tests): Token generation and position tracking
- Parser tests (10 tests): Structure building, edge cases, errors
- Writer tests (9 tests): Formatting, roundtrip validation
- Fixture tests (7 tests): Real-world INI files (sample, git, mypy, windows, multiline, edge cases)
- Error tests (11 tests): Malformed input, Unicode, stress tests (10K char lines, 100+ sections)
examples/read_example.mojo: Basic parsing demonstrationexamples/write_example.mojo: INI generation demonstrationexamples/file_io_example.mojo: File reading/writing with modifications
- Comprehensive README with Quick Start, usage examples, limitations
WARP.md: Development guidelines and architecture documentation- Performance benchmarks with statistical reporting (warmup + 5 trials)
- Small config (4 sections): ~9 μs parse, ~1 μs write
- Medium config (10 sections): ~97 μs parse, ~23 μs write
- Large config (50 sections): ~1038 μs parse, ~237 μs write
- Multiline values: ~14 μs parse
- 7-10x faster than Python for small configs
✅ Compatible:
- Basic key=value syntax
[Section]headers# commentsand; comments- Multiline values (indented continuations)
- Inline comments
- Empty values
- Special characters in values
🚧 Planned for v0.3.0:
[DEFAULT]section with value inheritance- Value interpolation
%(var)s ConfigParserclass API- Type converters (
getint,getboolean,getfloat) - Case-insensitive mode
Indented keys NOT supported (by design, matches Python configparser):
- Lines starting with whitespace are treated as multiline value continuations
- Tab-indented keys (Git config style) require removing leading tabs
- Workaround: Keep all keys at column 0, or use TOML/YAML for nested structures
- Language: Pure Mojo (zero Python dependencies at runtime)
- LOC: 1,426 total (733 source, 628 tests, 65 examples)
- Architecture: Three-stage pipeline (Lexer → Parser → Writer)
- Error Handling: Clear error messages with line numbers and context
- Package Manager: pixi for reproducible builds
- Pre-commit: TOML/YAML/JSON validation, whitespace/EOF checks
For detailed development plans, see docs/planning/ROADMAP.md