Get analysis of HDFC bank account and credit card statement
- Install CLI
pip install https://github.com/vipul-sharma20/hdfc-analytics/releases/download/v0.3.0/hdfc_analytics-0.3.0-py3-none-any.whl
(check releases for latest whl releases)
-
Prepare bank statement data. Check the configuration section below
-
Run the CLI
Account Statement Analysis
hdfc-analytics account --statement-csv=./configs/generated_statement.csv --categories-config=./configs/categories.toml --column-config=./configs/column_mapping.toml
Credit Card Statement Analysis
hdfc-analytics cc --statement-dir=./path-to-cc-statements/ --categories=./config/categories.toml --column-config=./configs/column_mapping.toml --name="JOHN DOE" --password=JOHN1211
Look at configs/
directory for sample configs and
more documentation later in the doc.
If you cannot manually build a categories config, you can use LLM to tag your
transactions. Use the --llm
flag.
You can give the model name in the --llm
flag which is of the format
<provider>/<model-name>
. You can also check how litellm supports
model names. I have tested this with OpenAI, Anthropic & a few models on Groq.
hdfc-analytics account --statement-csv=./configs/generated_statement.csv --categories-config=./configs/categories.toml --column-config=./configs/column_mapping.toml --llm=openai/gpt-4o
Note
I would recommend using a self-hosted LLM for tagging if you opt for LLMs to tag your transactions. Please don't give your data to anyone else.
You can use the --llm-host
tag along with --llm
in case you are planning to
use some self-hosted Ollama models.
hdfc-analytics account --statement-csv=./configs/generated_statement.csv --categories-config=./configs/categories.toml --column-config=./configs/column_mapping.toml --llm=ollama/llama3.2 --llm-host=http://localhost:11434
Sample set of configurations can be found in configs/
directory.
- Statement: HDFC provides bank statement in XLS format. Download and convert your statement to the format as defined in the sample statement. You'll only need to remove a few rows at the top and at the bottom of the generated statement. Clean and save it to a csv file
- Columns: This configuration stores custom column names to be mapped for the generated sheet columns. Sample config here.
- Categories: This configuration defines some list of strings under a category that the script tries to match and categorize each transactions into. Sample config here.
Warning
This is an open-source code. While there's no shady business happening in the code, I strongly suggest to use this at your own discretion. I strongly suggest all users to thoroughly vet and test the code before integration into any project or use in a production environment. I offer the code as-is and make no representations regarding its correctness, reliability, or safety