The Transaction Manager now supports importing and exporting categories as JSON files. This allows you to:
- Backup your category rules
- Share categories with other users
- Migrate categories between databases
- Version control your category configurations
- Go to the 🏷️ Manage Categories tab
- Click the 📤 Export Categories button
- Select which categories to export using the checkboxes
- Use Select All to choose all categories
- Use Deselect All to clear all selections
- Manually check/uncheck individual categories as needed
- Click Export Selected
- Choose a location and filename for the export file (default:
categories_export_YYYYMMDD.json) - Click Save
✓ Only your selected categories will be exported to a JSON file with metadata
- Go to the 🏷️ Manage Categories tab
- Click the 📥 Import Categories button
- Select a JSON file containing exported categories
- Select which categories to import using the checkboxes
- Use Select All to choose all categories from the file
- Use Deselect All to clear all selections
- Manually check/uncheck individual categories as needed
- Each category shows its pattern type and pattern for reference
- Choose import options:
- ☐ Update existing categories - If checked, categories with the same name will be updated with new patterns
- If unchecked, duplicate category names will be skipped
- Click Import Selected
- After import, you'll be prompted to Recategorize All Transactions to apply the new rules
The exported JSON file contains:
{
"version": "1.0",
"exported_at": "2025-10-15T12:00:00.000000",
"category_count": 5,
"categories": [
{
"name": "Amazon",
"pattern": "AMAZON",
"pattern_type": "contains",
"description": "Amazon purchases",
"color": "#FF9900"
},
...
]
}- version: Export format version (for compatibility)
- exported_at: Timestamp when the export was created
- category_count: Number of categories in the file
- categories: Array of category objects
| Field | Required | Description | Example |
|---|---|---|---|
name |
✓ | Category name (must be unique) | "Amazon" |
pattern |
✓ | Pattern to match in transaction descriptions | "AMAZON MKTPL" |
pattern_type |
✓ | Type of pattern matching | "contains", "regex", "startswith", "endswith", "exact" |
description |
Optional description | "Amazon marketplace purchases" | |
color |
Optional hex color code | "#FF9900" |
Matches if the pattern appears anywhere in the transaction description (case-insensitive).
Example:
{
"name": "Amazon",
"pattern": "AMAZON",
"pattern_type": "contains"
}Matches: "AMAZON MKTPL", "Amazon.com", "Purchase from Amazon"
Uses regular expressions for complex matching.
Example:
{
"name": "Gas Stations",
"pattern": "SHELL|CHEVRON|ARCO|76",
"pattern_type": "regex"
}Matches: "SHELL GAS", "CHEVRON STATION", "ARCO #123", "76 STATION"
Matches if the description starts with the pattern.
Example:
{
"name": "Apple Services",
"pattern": "APPLE.COM",
"pattern_type": "startswith"
}Matches: "APPLE.COM/BILL", "APPLE.COM iTunes"
Matches if the description ends with the pattern.
Matches only if the description exactly equals the pattern (case-insensitive).
Both import and export support cherry-picking - selecting only specific categories you want to work with.
Export Specific Categories:
- Share only relevant categories with someone (e.g., only business categories, not personal ones)
- Create focused category sets for specific purposes
- Export only tested/finalized categories, excluding experimental ones
- Backup specific category groups separately
Import Specific Categories:
- Import only categories you need from a larger set
- Avoid importing categories that conflict with your current setup
- Test new categories one at a time
- Selectively merge category sets from different sources
-
Export Dialog:
- Shows all your current categories with checkboxes
- All categories are selected by default
- Deselect categories you don't want to export
- Only checked categories are saved to the JSON file
-
Import Dialog:
- Shows all categories found in the import file with checkboxes
- All categories are selected by default
- Deselect categories you don't want to import
- Only checked categories are processed
Example 1: Share Business Categories Only
1. Click Export Categories
2. Click "Deselect All"
3. Manually check only business-related categories:
☑ Office Supplies
☑ Business Travel
☑ Client Meals
☐ Personal Shopping (leave unchecked)
☐ Family Dining (leave unchecked)
4. Export → share with business partner
Example 2: Test New Categories Individually
1. Receive a categories file with 20 new categories
2. Click Import Categories
3. Click "Deselect All"
4. Check only 1 category to test:
☑ Streaming Services
5. Import → Recategorize All → Review results
6. If good, repeat for other categories
Example 3: Merge Without Duplicates
1. Import a categories file
2. Review the list - some already exist
3. Uncheck categories you already have:
☐ Amazon (already have this)
☐ Groceries (already have this)
☑ Gas Stations (new - keep checked)
☑ Utilities (new - keep checked)
4. Import Selected
Before making major changes to your category rules:
- Export your current categories
- Save the file with a descriptive name (e.g.,
categories_backup_before_cleanup.json) - Make your changes
- If needed, you can re-import the backup
The application comes with a set of default categories loaded from default_categories.json:
- Amazon categories (Digital, Marketplace, POS)
- Apple services and subscriptions
- Streaming services (Netflix, Peacock, Prime Video)
- Gas stations and transportation
- Food delivery (DoorDash, etc.)
- Banking (Capital One, Cash App)
- Entertainment (Audible, Kindle)
These defaults are automatically loaded when the database is first initialized. You can:
- Customize the
default_categories.jsonfile to match your preferences - Export your current categories to see the format
- Import different default sets as needed
If multiple people use the Transaction Manager:
- One person creates and refines category rules
- Export the categories
- Share the JSON file with others
- Others import the categories to get the same rules
Build category sets for different purposes:
categories_personal.json- Personal expense categoriescategories_business.json- Business expense categoriescategories_tax.json- Tax-related categories
Switch between them by importing as needed.
Store your category files in Git or another version control system to:
- Track changes over time
- Revert to previous versions
- Document why categories changed
Categories that don't exist in your database will be added.
Two options:
Option 1: Skip duplicates (default)
- Existing categories remain unchanged
- Only new categories are added
- Duplicate names are reported as warnings
Option 2: Update existing (checkbox enabled)
- Categories with matching names are updated with new patterns
- Useful when importing refined versions of categories
After importing categories, you should:
- Click Recategorize All to apply the new rules to existing transactions
- Review the 📊 Summary tab to see the updated categorization
✓ "Amazon Marketplace"
✗ "AMZ"Help yourself remember what each category is for:
{
"name": "Subscription Services",
"pattern": "NETFLIX|SPOTIFY|HULU",
"pattern_type": "regex",
"description": "Monthly streaming and entertainment subscriptions"
}- Create a category in the GUI
- Click Recategorize All to test it
- View results in the Summary tab
- Once satisfied, export
Assign meaningful colors:
- 🔴 Red (#F44336) - Mandatory expenses (utilities, rent)
- 🟢 Green (#4CAF50) - Income, refunds
- 🔵 Blue (#2196F3) - Discretionary spending
- 🟡 Yellow (#FFC107) - Variable expenses (groceries, gas)
Export your categories regularly (monthly/quarterly) as backups.
- Ensure the file is valid JSON (use a JSON validator)
- Check for missing commas, brackets, or quotes
- Don't edit the file manually unless you're familiar with JSON
- This is normal if importing to a database that already has some categories
- Enable "Update existing categories" if you want to replace them
- Or manually delete conflicting categories before importing
- Click Recategorize All in the Manage Categories tab
- This applies all category rules to existing transactions
- Check that the JSON file has the correct format
- Ensure it has a "categories" array
- See the sample file:
categories_sample.json
1. Review uncategorized transactions in Summary tab
2. Create new categories for common patterns
3. Click Recategorize All
4. Export categories → categories_backup_YYYY-MM-DD.json
1. On old computer: Export Categories
2. Copy JSON file to new computer
3. On new computer: Install Transaction Manager
4. Import the categories JSON file
5. Import your transaction database or CSV files
6. Click Recategorize All
1. Export your refined categories
2. Email/share the JSON file
3. Family member imports the file
4. Both now use consistent categorization rules
The current export format is version 1.0. Future versions will remain backward compatible.
The importer also supports the legacy format (just an array of categories without metadata):
[
{
"name": "Amazon",
"pattern": "AMAZON",
"pattern_type": "contains"
}
]- CSV Import Settings: See
IMPORT_SETTINGS_GUIDE.md - Category Management: Use the Manage Categories tab for creating/editing categories
- Recategorize All: Applies all category rules to existing transactions
✓ Export - Backup and share your category rules ✓ Import - Restore or load category sets ✓ Cherry-Pick - Select specific categories to export or import ✓ JSON Format - Human-readable and version-control friendly ✓ Flexible - Skip or update duplicates as needed ✓ Safe - Preview before importing, backup before changes
- Select All / Deselect All buttons for quick selection
- Checkbox selection for both import and export
- Pattern preview showing what each category matches
- Validation ensures at least one category is selected
- Counts show exactly how many categories are being processed
For more help, see the main README.md or the application's help documentation.