Skip to content

Commit

Permalink
sort sections
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jul 17, 2026
1 parent c5179bf commit 38f6586
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from collections import defaultdict

# --- VERSIONING ---
__version__ = "1.3.0"
__version__ = "1.3.1"

UNIT_CONVERSION_MAP = {
"B": {"divisor": 1, "label": "Bytes"},
Expand All @@ -24,7 +24,7 @@ def find_latest_file(pattern):
return max(files, key=os.path.getctime) if files else None

def main():
parser = argparse.ArgumentParser(description="AWS S3 Fleet Storage Filtered Assessor Suite v1.3.0")
parser = argparse.ArgumentParser(description="AWS S3 Fleet Storage Filtered Assessor Suite v1.3.1")
parser.add_argument("--input", help="JSON file (default: latest audit_results.check_s3_buckets.*.json)")
parser.add_argument("--size-units", default="GB", choices=["B", "MB", "GB", "TB", "PB"],
help="Target size scale unit representation to output in reports (Default: GB)")
Expand Down Expand Up @@ -149,8 +149,8 @@ def main():
tf.write(fmt_tier.format(s_tier, scaled_tier_size, share))
tf.write("\n")

# --- NEW SECTION 5: TOP 20 LARGEST BUCKETS ---
tf.write("[SECTION 5: TOP 20 LARGEST BUCKETS BY INSTALLED VOLUME FOOTPRINT]\n")
# --- RE-ORDERED SECTION 4: TOP 20 LARGEST BUCKETS ---
tf.write("[SECTION 4: TOP 20 LARGEST BUCKETS BY INSTALLED VOLUME FOOTPRINT]\n")
size_data_spec = ",d" if target_unit == "B" else ",.2f"
fmt_top_size_header = f" {{:<4}} | {{:<12}} | {{:<{max_alias_w}}} | {{:<{max_bucket_w}}} | {{:<12}} | {{:>18}} | {{:>12}}\n"
fmt_top_size_data = f" #{{:<3}} | {{:<12}} | {{:<{max_alias_w}}} | {{:<{max_bucket_w}}} | {{:<12}} | {{:>18{size_data_spec}}} | {{:>12,}}\n"
Expand All @@ -165,8 +165,8 @@ def main():
tf.write(fmt_top_size_data.format(idx, r[0], r[1], r[2], r[3], scaled_bucket_size, r[6]))
tf.write("\n")

# --- NEW SECTION 6: TOP 20 BUCKETS BY TOTAL OBJECT COUNT ---
tf.write("[SECTION 6: TOP 20 MOST POPULATED BUCKETS BY ALLOCATED OBJECT DENSITY]\n")
# --- RE-ORDERED SECTION 5: TOP 20 BUCKETS BY TOTAL OBJECT COUNT ---
tf.write("[SECTION 5: TOP 20 MOST POPULATED BUCKETS BY ALLOCATED OBJECT DENSITY]\n")
fmt_top_obj_header = f" {{:<4}} | {{:<12}} | {{:<{max_alias_w}}} | {{:<{max_bucket_w}}} | {{:<12}} | {{:>18}} | {{:>12}}\n"
fmt_top_obj_data = f" #{{:<3}} | {{:<12}} | {{:<{max_alias_w}}} | {{:<{max_bucket_w}}} | {{:<12}} | {{:>18{size_data_spec}}} | {{:>12,}}\n"

Expand All @@ -179,8 +179,8 @@ def main():
tf.write(fmt_top_obj_data.format(idx, r[0], r[1], r[2], r[3], scaled_bucket_size, r[6]))
tf.write("\n")

# Section 4: Master Matrix Table
tf.write("[SECTION 4: GRANULAR BUCKET METADATA INVENTORY MATRIX]\n")
# --- RE-ORDERED SECTION 6: MASTER MATRIX TABLE ---
tf.write("[SECTION 6: GRANULAR BUCKET METADATA INVENTORY MATRIX]\n")
fmt_row_header = f" {{:<12}} | {{:<{max_alias_w}}} | {{:<{max_bucket_w}}} | {{:<12}} | {{:>18}} | {{:>12}} | {{:<10}} | {{:<13}}\n"
fmt_row_data = f" {{:<12}} | {{:<{max_alias_w}}} | {{:<{max_bucket_w}}} | {{:<12}} | {{:>18{size_data_spec}}} | {{:>12,}} | {{:<10}} | {{:<13}}\n"

Expand Down

0 comments on commit 38f6586

Please sign in to comment.