wtftools 0.0.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.
wtftools/__init__.py ADDED
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """WTFTools — one command to see what is going on with your server.
4
+
5
+ This module exposes a small **stable public API** for callers that want to
6
+ embed wtftools logic instead of running the CLI:
7
+
8
+ >>> from wtftools import run_audit, CheckResult
9
+ >>> results = run_audit()
10
+ >>> failed = [r for r in results if r.status == "fail"]
11
+
12
+ That surface is intentionally narrow — everything else (config helpers,
13
+ sysinfo, plugins, daemon) lives in submodules and may change between
14
+ versions without a notice. Import the submodules directly if you need them.
15
+ """
16
+
17
+ # Version is the single-source-of-truth in pyproject.toml. We read it back via
18
+ # importlib.metadata so `wtftools.__version__` continues to work for embedders.
19
+ try:
20
+ from importlib.metadata import PackageNotFoundError
21
+ from importlib.metadata import version as _pkg_version
22
+
23
+ try:
24
+ __version__ = _pkg_version("wtftools")
25
+ except PackageNotFoundError:
26
+ # Source checkout without an editable install; fall through to dev tag.
27
+ __version__ = "0+unknown"
28
+ except ImportError:
29
+ __version__ = "0+unknown"
30
+
31
+ __description__ = "One command to summarize what is happening on your Linux server right now."
32
+ __url__ = "https://github.com/wachawo/wtftools"
33
+ __author__ = "Aleksandr Pimenov"
34
+ __license__ = "MIT"
35
+
36
+ # Stable embedding-friendly surface. Submodules are imported lazily so the
37
+ # `wtftools` module itself stays cheap to import (e.g. for `--version`).
38
+ __all__ = [
39
+ "__version__",
40
+ "__description__",
41
+ "__url__",
42
+ "CheckResult",
43
+ "run_audit",
44
+ "summarize",
45
+ "list_check_names",
46
+ ]
47
+
48
+
49
+ def __getattr__(name):
50
+ """Lazy re-export of the audit module's stable surface."""
51
+ if name in ("CheckResult", "run_audit", "summarize", "list_check_names"):
52
+ from wtftools import audit
53
+
54
+ return getattr(audit, name)
55
+ raise AttributeError(f"module 'wtftools' has no attribute {name!r}")
wtftools/__main__.py ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """Entry point for `python3 -m wtftools`."""
4
+
5
+ import sys
6
+
7
+ from wtftools.main import main
8
+
9
+ if __name__ == "__main__":
10
+ sys.exit(main())