netdiag-cli 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- netdiag/__init__.py +6 -0
- netdiag/banner.py +37 -0
- netdiag/cli.py +1260 -0
- netdiag/compare_targets.py +36 -0
- netdiag/completion.py +115 -0
- netdiag/config.py +34 -0
- netdiag/display.py +343 -0
- netdiag/dns_all.py +45 -0
- netdiag/dns_config.py +126 -0
- netdiag/dns_tools.py +122 -0
- netdiag/doctor.py +140 -0
- netdiag/enrichment.py +256 -0
- netdiag/exit_codes.py +15 -0
- netdiag/health_check.py +97 -0
- netdiag/host_info.py +331 -0
- netdiag/http_extras.py +216 -0
- netdiag/http_probe.py +328 -0
- netdiag/info.py +66 -0
- netdiag/ipcalc.py +96 -0
- netdiag/json_out.py +30 -0
- netdiag/latency_probe.py +83 -0
- netdiag/models.py +55 -0
- netdiag/oncall.py +272 -0
- netdiag/port_scan.py +116 -0
- netdiag/presets.py +92 -0
- netdiag/serialize.py +54 -0
- netdiag/speed.py +485 -0
- netdiag/ssl_ctx.py +66 -0
- netdiag/stats.py +152 -0
- netdiag/targets.py +72 -0
- netdiag/tools.py +69 -0
- netdiag/traceroute.py +169 -0
- netdiag/vpn_diag.py +184 -0
- netdiag_cli-0.1.0.dist-info/METADATA +203 -0
- netdiag_cli-0.1.0.dist-info/RECORD +38 -0
- netdiag_cli-0.1.0.dist-info/WHEEL +4 -0
- netdiag_cli-0.1.0.dist-info/entry_points.txt +2 -0
- netdiag_cli-0.1.0.dist-info/licenses/LICENSE +21 -0
netdiag/__init__.py
ADDED
netdiag/banner.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
from typing import TextIO
|
|
6
|
+
|
|
7
|
+
# Block wordmark (UTF-8); disable with NETDIAG_NO_BANNER=1 on narrow terminals
|
|
8
|
+
BANNER_LINES: tuple[str, ...] = (
|
|
9
|
+
" ▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ",
|
|
10
|
+
"▐░░▌ ▐░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌",
|
|
11
|
+
"▐░▌░▌ ▐░▌▐░█▀▀▀▀▀▀▀▀▀ ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ",
|
|
12
|
+
"▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ",
|
|
13
|
+
"▐░▌ ▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▄▄▄▄▄▄▄▄ ",
|
|
14
|
+
"▐░▌ ▐░▌ ▐░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░▌▐░░░░░░░░▌",
|
|
15
|
+
"▐░▌ ▐░▌ ▐░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▀▀▀▀▀▀█░▌",
|
|
16
|
+
"▐░▌ ▐░▌▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌",
|
|
17
|
+
"▐░▌ ▐░▐░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░█▄▄▄▄▄▄▄█░▌▄▄▄▄█░█▄▄▄▄ ▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄█░▌",
|
|
18
|
+
"▐░▌ ▐░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░░░░░░░░░░░▌",
|
|
19
|
+
" ▀ ▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ",
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def banner_enabled() -> bool:
|
|
24
|
+
value = os.environ.get("NETDIAG_NO_BANNER", "").strip().lower()
|
|
25
|
+
return value not in ("1", "true", "yes", "on")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def banner_text() -> str:
|
|
29
|
+
return "\n".join(BANNER_LINES)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def print_banner(*, stream: TextIO | None = None) -> None:
|
|
33
|
+
if not banner_enabled():
|
|
34
|
+
return
|
|
35
|
+
out = stream or sys.stdout
|
|
36
|
+
out.write(banner_text())
|
|
37
|
+
out.write("\n\n")
|