I have built a CLI tool to analyze HDFC bank account and credit card
statements called hdfc-analytics
.
Summary
The tool goes through your account statement / credit card statement and tags it based on the category configs that you provide.
NOTE
Better documentation is in the repository and maintained more than the content in this post below
For example if you run the CLI code as below
hdfc-analytics account --statement-csv=./configs/generated_statement.csv --categories-config=./configs/categories.toml --column-config=./configs/column_mapping.toml
It can generates a plot of your expense tagged by category like below
Category configurations are defined as follows. These configurations contain keywords that are searched for in the transaction descriptions or summaries of account statements. Transactions are then categorized based on the corresponding category specified in the TOML configuration.
NOTE
All the configs / examples are just samples
[Groceries]
keywords = ["grocery", "grocer"]
[Food]
keywords = ["lunch", "dinner", "breakfast", "food", "starbucks", "mcdonalds"]
[Investments]
keywords = ["investment", "mutual fund", "stonk", "stock"]
[CreditCard]
keywords = ["credit card", "autopay"]
[Rent]
keywords = ["rent"]
[Transportation]
keywords = ["uber", "ola"]
[Clothes]
keywords = ["myntra"]
[Subscriptions]
keywords = ["subscription", "linkedin", "membership", "cloud storage"]
[Health]
keywords = ["diagnostic"]
[Travel]
keywords = ["cleartrip", "vistara", "makemytrip", "airline", "hotel"]
[Shopping]
keywords = ["amazon", "shopping"]
Release Timelines
- November 2023: Originally, I had created this tool to analyze only account statements and launched as v0.1.0.
- February 2025: Implemented support to tag account transactions using LLMs in v0.2.0.
- February 2025: Added support to analyze credit card statements in v0.3.0.
Updates
I am now looking to add a feature to support analysis of both account and
credit card statements together and provide a consolidated view of expenses.
Currently, you would have to run account
and cc
commands separately to get
the expense plot.
I am adding support for this in a feature branch here. I’ll have to make sure that credit card expense / bill payment are considered only once. Explanation of this problem is in the commit message here.
Looking to launch this feature in v0.3.0 and should look like the command below
hdfc-analytics total --statement-dir=./configs/statements/ --categories=./configs/categories.toml --column-config=./configs/column_mapping.toml --name="JOHN DOE" --password=JOHN1384 --statement-csv=./configs/statement.csv