A stupid-simple, open-source CRED alternative for India. Reads your Gmail for credit card statements, parses PDFs, extracts due dates and amounts, and sends you daily reminders on Telegram.
No app. No bloat. Just Python, SQLite, and cron.
- Gmail Scanning — Automatically finds statement emails from HDFC, Axis, ICICI, SBI, and more
- PDF Parsing — Bank-specific extractors + learning engine for unknown statements
- Auto-Password Unlock — Uses your registered card details to guess PDF passwords
- Payment Detection — Auto-marks bills as paid via CRED confirmations and bank debit alerts
- Telegram Reminders — Daily morning reminders with exact due date and amount
- Self-Learning — When a new bank format appears, the bot asks you to
/teachit - Multi-Card Support — Register multiple cards per bank, all tracked independently
Daily Cron (8 AM)
│
▼
[Gmail API] → Fetch statement emails with PDFs
│
▼
[PDF Extractor] → Try passwords from registered cards
│
▼
[Bank Extractors] → Try HDFC, Axis, ICICI parsers
│
▼
[Pattern Matcher] → Try learned regex patterns
│
▼
[LLM Fallback] → Ask OpenRouter to parse unknown text
│
▼
[Payment Detector] → Scan for CRED / bank debit alerts
│
▼
[Telegram] → Send reminder for pending dues
git clone https://github.com/rShetty/momento.git
cd momento
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtMessage @BotFather on Telegram:
- Send
/newbot - Name it:
KreditKard - Username it:
yourname_kard_bot(must end in_bot) - Copy the token BotFather gives you
cp .env.example .envEdit .env:
TELEGRAM_BOT_TOKEN=your_bot_token_here
TELEGRAM_CHAT_ID=your_chat_id_here
# (we'll get Chat ID in step 5)You need: Google Cloud project with Gmail API enabled
Run the auth helper:
python auth.pyThis will:
- Print a Google OAuth URL
- Open your browser
- Ask you to login and approve
- Save
token.jsonlocally (never commit this)
Prerequisites for auth.py:
- Download your
client_secret_XXX.jsonfrom Google Cloud Console - Place it in the project root
- Add
http://localhost:8080as an authorized redirect URI
See SETUP.md for detailed Google Cloud Console steps.
- Message your bot
/start - Run this quick script:
python -c "
from telegram import Bot
import asyncio
async def main():
bot = Bot(token='YOUR_BOT_TOKEN')
updates = await bot.get_updates()
if updates:
print(f'Chat ID: {updates[-1].message.chat.id}')
asyncio.run(main())
"- Put that Chat ID in your
.env
Message your bot:
/register
Follow the wizard:
- Select bank (HDFC, Axis, etc.)
- Enter cardholder name (as on card)
- Enter last 4 digits
- Give it a nickname (e.g., "My Swiggy Card")
- Confirm or customize the PDF password pattern
python main.pyYou should see:
- Gmail emails found
- PDFs downloaded
- Bills parsed and saved
- Reminders sent to Telegram
crontab -eAdd:
0 8 * * * cd /path/to/momento && /path/to/momento/.venv/bin/python main.py >> /path/to/momento/run.log 2>&1| Command | Action |
|---|---|
/start |
Show all commands |
/register |
Add a new credit card (wizard) |
/my_cards |
List registered cards |
/delete_card <id> |
Remove a registered card |
/status |
Show pending dues |
/paid <bill_id> |
Mark a specific bill as paid |
/paid <bank> <MM> |
Mark bank's bill for month as paid |
/forcecheck |
Run Gmail scan immediately |
/teach <bank> due:XX amount:XX ... |
Teach the bot a new format |
/confirm <bank> due:XX amount:XX ... |
Confirm LLM guess and learn |
/patterns <bank> |
Show learned patterns |
/history <bank> |
Show recent bills |
momento/
├── main.py # Cron entry point
├── telegram_bot.py # Bot command handlers
├── config.py # Settings & bank mappings
├── db.py # SQLite persistence
├── utils.py # Date/amount/text helpers
├── gmail_client.py # Gmail API wrapper
├── pdf_extractor.py # PyMuPDF wrapper
├── hdfc_extractor.py # Bank-specific parsers
├── pattern_matcher.py # Generic pattern engine
├── pattern_generator.py # Auto-pattern builder
├── llm_client.py # OpenRouter fallback
├── payment_detector.py # CRED / bank payment scanner
├── reminder.py # Telegram sender
├── auth.py # Gmail OAuth helper
├── .env # Your secrets (gitignored)
├── .env.example # Template
├── requirements.txt
├── SETUP.md # Detailed setup guide
└── README.md # This file
.envandtoken.jsonare in.gitignore— never commit them- Gmail scope is read-only — cannot send, delete, or mark emails as read
- PDFs are stored locally, never uploaded
- LLM calls send only text snippets, never full binary PDFs
This is a personal project but PRs welcome:
- Add extractors for more Indian banks
- Improve PDF password pattern detection
- Better payment confirmation matching
MIT. Do whatever you want. Not responsible if you miss a payment.