tokenomics 0.5.1__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.
tokenomics/__init__.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = "0.5.1"
tokenomics/__main__.py ADDED
@@ -0,0 +1,3 @@
1
+ from tokenomics.cli import main
2
+
3
+ main()
tokenomics/cli.py ADDED
@@ -0,0 +1,35 @@
1
+ """Thin CLI dispatcher for tokenomics subcommands."""
2
+
3
+ import sys
4
+
5
+
6
+ SUBCOMMANDS = {
7
+ "completion": ("tokenomics.completion_benchmark", "main"),
8
+ "embedding": ("tokenomics.embedding_benchmark", "main"),
9
+ "plot-completion": ("tokenomics.plot_completion_benchmark", "main"),
10
+ "plot-embedding": ("tokenomics.plot_embedding_benchmark", "main"),
11
+ }
12
+
13
+
14
+ def main():
15
+ if len(sys.argv) < 2 or sys.argv[1] in ("-h", "--help"):
16
+ print("usage: tokenomics <subcommand> [args ...]\n")
17
+ print("subcommands:")
18
+ for name in SUBCOMMANDS:
19
+ print(f" {name}")
20
+ print("\nRun 'tokenomics <subcommand> --help' for subcommand help.")
21
+ sys.exit(0)
22
+
23
+ name = sys.argv[1]
24
+ if name not in SUBCOMMANDS:
25
+ print(f"error: unknown subcommand '{name}'")
26
+ print(f"available: {', '.join(SUBCOMMANDS)}")
27
+ sys.exit(1)
28
+
29
+ # Strip the subcommand from argv so argparse in each module sees the right args
30
+ sys.argv = [f"tokenomics {name}"] + sys.argv[2:]
31
+
32
+ module_path, func_name = SUBCOMMANDS[name]
33
+ from importlib import import_module
34
+ mod = import_module(module_path)
35
+ getattr(mod, func_name)()