make matplotlib mandatory

This commit is contained in:
Fabian Montero 2026-03-09 22:15:07 -06:00
parent ba883a5868
commit 23304ba20e
Signed by: fabian
GPG key ID: 8036F30EDBAC8447

View file

@ -12,11 +12,7 @@ import sys
from collections import defaultdict
from pathlib import Path
try:
import matplotlib.pyplot as plt
HAS_MATPLOTLIB = True
except ImportError:
HAS_MATPLOTLIB = False
def load_transactions(json_files: list[Path]) -> list[dict]:
@ -208,10 +204,6 @@ def main():
if not path.exists():
sys.exit(f"Error: File not found: {path}")
# Check matplotlib early if graph requested
if args.graph and not HAS_MATPLOTLIB:
sys.exit("Error: matplotlib is required for graphs. Install with: pip install matplotlib")
# Load categories
if not args.categories.exists():
sys.exit(f"Error: Categories file not found: {args.categories}")