import os from pathlib import Path total = sum(f.stat().st_size for f in Path("/data/matches").rglob("*") if f.is_file()) print(f"/data/matches: {total / 1024**3:.2f} GB") total2 = sum(f.stat().st_size for f in Path("/data/by-language").rglob("*") if f.is_file()) print(f"/data/by-language: {total2 / 1024**3:.2f} GB") total3 = sum(f.stat().st_size for f in Path("/data/image-shards").rglob("*") if f.is_file()) print(f"/data/image-shards: {total3 / 1024**3:.2f} GB")