Skip to content

Add metadata support to categorizer (v0.8.0) (#15)

Choose a tag to compare

@mabahamo mabahamo released this 22 Jan 09:27
· 18 commits to main since this release
5eebadd
This update allows categorizers to add custom metadata to transactions through
the categorizer return dict. This enables better transaction tracking,
analysis, and compliance.

Changes:
- Add 'metadata' field to CategorizerReturn type
- Update both BancoChileImporter and BancoChileCreditImporter to merge
  custom metadata from categorizer results
- Add comprehensive tests for metadata functionality
- Update CLAUDE.md documentation with metadata examples
- Bump version to 0.8.0

Example usage:
```python
def categorizer(date, payee, narration, amount, metadata):
    if "AMAZON" in payee.upper():
        return {
            "category": "Expenses:Shopping:Online",
            "metadata": {
                "merchant_category": "online",
                "tax_deductible": False,
                "reviewed": True,
            }
        }
    return None
```

All 80 tests pass successfully.