upi_sms_parser library
A pure-Dart library for parsing Indian UPI transaction SMS messages.
Has zero Flutter dependencies — it works equally well in a Flutter
app, a server-side Dart program, or a plain command-line tool. The
only types it depends on come from dart:core.
Developers who add this package only need to import this single file:
import 'package:upi_sms_parser/upi_sms_parser.dart';
final parser = UpiParser();
final result = parser.parse(smsBody, senderAddress);
What gets exported, and why you'd reach for each piece:
- UpiParser — the main API: filters AND extracts in one call. This is what almost everyone should start with.
- ParsedTransaction / UpiTransactionType — the data shape UpiParser.parse hands back; you'll reference these types when storing or displaying results.
- UpiSmsFilter — the standalone "is this a real transaction SMS?" gate sequence, for callers who want to filter without parsing (e.g. deciding what to keep in an inbox cache).
- UpiSmsExtractor — the standalone field-extraction functions, for callers who only need one specific piece of data (e.g. "just give me the amount") without running the full pipeline.
Classes
- ParsedTransaction
- The structured result of parsing a single UPI transaction SMS.
- UpiParser
- UpiSmsExtractor
- UpiSmsFilter
Enums
- UpiTransactionType
- Which direction money moved in a UPI transaction.