| name | zenith-finance-maintenance |
| description | Maintain Zenith Finance local files (Ledger.md and Transactions.md) in an easy-to-maintain format.
Provides simple key-value format for ledger, standard transaction format, helper scripts,
and procedures for fixing common formatting issues while maintaining compatibility with Google Sheets sync.
|
| version | 1.0.0 |
| author | Hermes Agent (for Adit) |
| license | MIT |
| metadata | {"hermes":{"tags":["Finance","Accounting","Ledger","Transactions","Maintenance","Zenith","obi"]}} |
Zenith Finance Local File Maintenance
This skill provides methods to maintain Zenith Finance's local files (Ledger.md and Transactions.md)
in formats that are easy to maintain, parse, and update programmatically while remaining
human-readable and compatible with the zenith-finance-sync skill for Google Sheets synchronization.
Problem
The default Zenith Finance Ledger.md format uses complex markdown that can break when edited:
- **BCA (Main Bank)**: Rp28.632.790,57
This format is prone to errors when:
- Manually editing the file
- Using search/replace operations
- Programmatic updates with regex
- Accidental removal of markdown formatting
Solution: Easy Maintenance Format
Ledger.md Format
Convert to simple key-value pairs:
## Liquid Assets
BCA: 28632790
Blu: 175501
Gopay: 6670
Dompet: 452000
## Investments
RDN: 7231400
Emas: 11936534
Benefits:
- Easy to read and edit
- Simple to parse with regex or split
- Hard to break accidentally
- Compatible with helper scripts
- Still human-readable
Transactions.md Format
Keep the existing pipe-delimited format (already optimal):
[YYYY-MM-DD HH:MM] | Description - RpAmount | Category | Source | RpBalance
Example:
[2026-04-11 09:51] | Gojek - Rp20,490.00 | Food | BCA (Main Bank) | Rp28,643,790.57
Benefits:
- Each transaction on its own line (easy to append/modify/remove)
- Consistent format for parsing
- Already compatible with zenith-finance-sync
- Human-readable
Helper Script: update_ledger.py
A Python script for easy ledger updates:
"""
Helper script to update Ledger.md values easily.
Usage: python3 update_ledger.py --bca 28632790 --blu 175501 --gopay 6670 --dompet 452000 --rdn 7231400 --emas 11936534
"""
import argparse
import os
import re
def update_ledger(bca=None, blu=None, gopay=None, dompet=None, rdn=None, emas=None):
ledger_path = os.path.join(os.path.dirname(__file__), "Ledger.md")
with open(ledger_path, 'r') as f:
content = f.read()
if bca is not None:
content = re.sub(r'(BCA: )\d+', f'\\1{bca}', content)
if blu is not None:
content = re.sub(r'(Blu: )\d+', f'\\1{blu}', content)
if gopay is not None:
content = re.sub(r'(Gopay: )\d+', f'\\1{gopay}', content)
if dompet is not None:
content = re.sub(r'(Dompet: )\d+', f'\\1{dompet}', content)
if rdn is not None:
content = re.sub(r'(RDN: )\d+', f'\\1{rdn}', content)
if emas is not None:
content = re.sub(r'(Emas: )\d+', f'\\1{emas}', content)
with open(ledger_path, 'w') as f:
f.write(content)
print("Ledger.md updated successfully!")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Update Ledger.md values')
parser.add_argument('--bca', type=int, help='BCA balance')
parser.add_argument('--blu', type=int, help='Blu balance')
parser.add_argument('--gopay', type=int, help='Gopay balance')
parser.add_argument('--dompet', type=int, help='Dompet balance')
parser.add_argument('--rdn', type=int, help='RDN balance')
parser.add_argument('--emas', type=int, help='Emas value')
args = parser.parse_args()
update_ledger(
bca=args.bca,
blu=args.blu,
gopay=args.gopay,
dompet=args.dompet,
rdn=args.rdn,
emas=args.emas
)
Place this script in: ~/Documents/Obsidian/Notes/Finance/update_ledger.py
Make it executable: chmod +x update_ledger.py
Common Maintenance Tasks
1. Updating a Balance
python3 ~/Documents/Obsidian/Notes/Finance/update_ledger.py --bca 28632790
python3 ~/Documents/Obsidian/Notes/Finance/update_ledger.py --bca 28632790 --blu 175501
2. Adding a Transaction
Append to Transactions.md in the standard format:
[YYYY-MM-DD HH:MM] | Merchant - RpAmount | Category | Source | RpRunningBalance
Example:
[2026-04-11 10:15] | Kopi Soklin - Rp15,000.00 | Food | BCA (Main Bank) | Rp28,617,790.57
3. Fixing Concatenated Transactions
If transactions get concatenated (missing newline between them):
... | Rp28,632,790.57[2026-04-11 10:12] | Goride ...
Use this Python snippet to fix:
import re
def fix_concatenated_transactions(content):
pattern = r'(\| Rp\d[\d.,]*\.\d{2})(\[[^\]]+\])'
return re.sub(pattern, r'\1\n\2', content)
with open('Transactions.md', 'r') as f:
content = f.read()
fixed = fix_concatenated_transactions(content)
with open('Transactions.md', 'w') as f:
f.write(fixed)
4. Backup and Restore
Before making major changes:
mkdir -p ~/Documents/Obsidian/Notes/Finance/backups
cp ~/Documents/Obsidian/Notes/Finance/Ledger.md ~/Documents/Obsidian/Notes/Finance/backups/Ledger_$(date +%Y%m%d_%H%M%S).md
cp ~/Documents/Obsidian/Notes/Finance/Transactions.md ~/Documents/Obsidian/Notes/Finance/backups/Transactions_$(date +%Y%m%d_%H%M%S).md
To restore:
cp ~/Documents/Obsidian/Notes/Finance/backups/Ledger_20260411_100447.md ~/Documents/Obsidian/Notes/Finance/Ledger.md
cp ~/Documents/Obsidian/Notes/Finance/backups/Transactions_20260411_100447.md ~/Documents/Obsidian/Notes/Finance/Transactions.md
Compatibility with zenith-finance-sync
This maintenance approach remains fully compatible with the zenith-finance-sync skill because:
- Ledger.md: The sync script parses the values regardless of format (it extracts numbers from patterns like
Rp[\d.,]+)
- Transactions.md: The sync script expects the pipe-delimited format which we preserve
- Formulas: The sync preserves custom formulas in Dashboard cells (especially B2/B3 SUMIFs) as specified in zenith-finance-sync
When to Use
Use this skill when you want to:
- Maintain Zenith Finance records in a format that's resistant to accidental breakage
- Easily update balances without worrying about markdown formatting
- Add/remove/modify transactions safely
- Fix common formatting issues like concatenated transactions
- Maintain compatibility with Google Sheets synchronization
- Have a reliable backup and restore procedure
Example Workflow
-
Record new expense:
python3 update_ledger.py --bca 28612300
echo "[2026-04-11 10:15] | Gojek - Rp20,490.00 | Food | BCA (Main Bank) | Rp28,612,300.57" >> Transactions.md
-
Sync to Google Sheets:
zenith-finance-sync
-
Verify:
- Check Ledger.md shows updated balance
- Check Transactions.md has new line
- Verify Google Sheets updated via zenith-finance-sync output
Notes
- The Ledger.md values are stored as integers (no decimal places) for simplicity
- Transactions.md uses standard format with 2 decimal places for currency
- Always ensure Transactions.md ends with a newline
- Run zenith-finance-sync after making changes to back up to Google Sheets
- Keep the update_ledger.py script in your Finance directory for easy access