Untitled

asn_column_check.py

#!/usr/bin/env python3
"""Keep ASN claims in a plan-comparison CSV tied to what is published.

An ASN identifies the network an address belongs to. Rows without
a published ASN breakdown stay "not published": the network answer
is the field that separates proxy types, so guessing is worse
than leaving the cell honest.
"""
import csv, sys

def normalize(row):
    v = (row.get("asn_breakdown") or "").strip()
    if v.lower() in ("", "none", "not published", "-"):
        row["asn_breakdown"] = "not published"
    return row

if __name__ == "__main__":
    with open(sys.argv[1], newline="") as fh:
        for row in csv.DictReader(fh):
            print(normalize(dict(row)))

Keep the ASN column of a plan row honest: an ASN identifies the network an address belongs to, and it is the single field that separates proxy types. Proxy Compare records what providers publish about their pools, and the silence where they do not, on its ASN page.

MIT License. This utility is original tooling and makes no plan recommendation.