visidata: add IOC types with cached, throttled lookups

Centralize provider caching and rate-limit handling, then add Domain/URL/Hash IOC types and safer VT/IPInfo key resolution so lookups stay reliable on free-tier APIs.
This commit is contained in:
tobias
2026-02-21 23:10:44 +01:00
parent a931be4707
commit 84d912ac0a
9 changed files with 1048 additions and 173 deletions

View File

@@ -96,6 +96,10 @@ class IPInfo:
return self.raw.get(name)
raise AttributeError(name)
def __call__(self) -> "IPInfo":
# Allow `ip.ipinfo()` in VisiData expressions.
return self
@dataclass(frozen=True)
class ASNInfo:
@@ -114,6 +118,9 @@ class ASNInfo:
return self.raw.get(name)
raise AttributeError(name)
def __call__(self) -> "ASNInfo":
return self
@dataclass(frozen=True)
class VTInfo:
@@ -150,6 +157,9 @@ class VTInfo:
return self.raw.get(name)
raise AttributeError(name)
def __call__(self) -> "VTInfo":
return self
@dataclass(frozen=True)
class GeoInfo:
@@ -173,6 +183,9 @@ class GeoInfo:
return self.raw.get(name)
raise AttributeError(name)
def __call__(self) -> "GeoInfo":
return self
def _to_float(v: Any) -> Optional[float]:
try: