mrz_parser
2.0.1, released 2 years ago by leushchenko.com
Parse Machine Readable Zone (MRZ) strings from identity documents
WASM-ready
What it does
Provides a parser for MRZ formats TD1, TD2, TD3, MRV-A, MRV-B. Supports null‑safe Dart 2 and Dart 3, with error handling via MRZException and a tryParse helper.
AI-written summary of version 2.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to extract data from passports or ID cards
- You want a lightweight, pure Dart solution without external dependencies
- You need support for long document numbers per ICAO 9303 part 5
Skip it when
- You require a full document scanning pipeline (camera, OCR)
- You need to validate MRZ against a backend service
- You are building a UI component that displays MRZ data
Strengths
- Pure Dart, no native dependencies
- Supports multiple MRZ formats and long document numbers
- Null‑safe and compatible with Dart 2 and 3
- Provides both parse and tryParse for error handling
Weaknesses
- No OCR or image capture support
- Limited to parsing, not validation against external data
- No UI widgets for displaying MRZ
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Add mrz_parser: ^2.0.0 to pubspec and import 'package:mrz_parser/mrz_parser.dart'; no build_runner needed
final mrz = [
'P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<',
'L898902C36UTO7408122F1204159ZE184226B<<<<<10'
];
final result = MRZParser.tryParse(mrz);Alternatives
Packages that do the same job and could replace mrz_parser.
- math_parser
Parse and evaluate mathematical expressions in Dart.
52Compare - duration
Format and parse human‑readable durations in Dart
50Compare
Works with
Packages commonly used together with mrz_parser: ones it builds on, ones built on it, and its own family.