update docs
This commit is contained in:
parent
7297abadcd
commit
12e818b82c
2 changed files with 79 additions and 20 deletions
59
README.md
59
README.md
|
|
@ -1,13 +1,16 @@
|
|||
# BAC Statement Extractor
|
||||
# BAC Statement Tools
|
||||
|
||||
Extracts credit card transactions from BAC Costa Rica statement PDFs. Parses sections B (purchases), D (other charges), and E (voluntary services) and outputs JSON.
|
||||
Tools for processing BAC Costa Rica credit card statement PDFs.
|
||||
|
||||
## Dependencies
|
||||
|
||||
- Python 3.10+
|
||||
- pdfplumber (>=0.10.0)
|
||||
- matplotlib (>=3.5.0) - optional, for graphs
|
||||
|
||||
## Usage
|
||||
## Extraction
|
||||
|
||||
Extract transactions from statement PDFs to JSON.
|
||||
|
||||
```bash
|
||||
python bac_extract.py <pdf_file> [options]
|
||||
|
|
@ -24,6 +27,56 @@ python bac_extract.py statement.pdf --pretty
|
|||
python bac_extract.py statement.pdf -o output.json -v
|
||||
```
|
||||
|
||||
## Analysis
|
||||
|
||||
Analyze extracted transactions with category breakdowns and graphs.
|
||||
|
||||
```bash
|
||||
python bac_analyze.py <json_files...> [options]
|
||||
```
|
||||
|
||||
**Options:**
|
||||
- `--graph {bar,pie,timeline,all}`: Generate graph(s)
|
||||
- `-o, --output`: Output file for graph (default: spending_<type>.png)
|
||||
- `--show`: Display graph interactively
|
||||
- `--categories`: Custom categories file (default: categories.json)
|
||||
|
||||
**Examples:**
|
||||
```bash
|
||||
# Text summary
|
||||
python bac_analyze.py transactions.json
|
||||
|
||||
# Analyze multiple statements
|
||||
python bac_analyze.py *.json
|
||||
|
||||
# Generate all graphs
|
||||
python bac_analyze.py *.json --graph all
|
||||
|
||||
# Generate bar chart with custom output
|
||||
python bac_analyze.py *.json --graph bar -o spending.png
|
||||
|
||||
# Use custom categories
|
||||
python bac_analyze.py *.json --categories my_categories.json
|
||||
```
|
||||
|
||||
## Categories
|
||||
|
||||
Create a `categories.json` file to customize spending categories. Each category maps to a list of merchant name patterns (case-insensitive substring match).
|
||||
|
||||
```json
|
||||
{
|
||||
"Groceries": ["SUPERMARKET", "WALMART", "FRESH MARKET"],
|
||||
"Gas": ["SERVICENTRO", "DELTA", "SHELL"],
|
||||
"Restaurants": ["RESTAURANT", "CAFE", "PIZZA", "SUSHI"],
|
||||
"Transportation": ["UBER", "TAXI", "PARKING"],
|
||||
"Entertainment": ["CINEMA", "NETFLIX", "STEAM"],
|
||||
"Utilities": ["ELECTRIC", "WATER", "INTERNET"],
|
||||
"Subscriptions": ["SPOTIFY", "YOUTUBE", "CHATGPT"]
|
||||
}
|
||||
```
|
||||
|
||||
Transactions not matching any pattern are categorized as "Other".
|
||||
|
||||
## Output Format
|
||||
|
||||
```json
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue