tensors 0.1.4__py3-none-any.whl → 0.1.5__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.
tensors/cli.py CHANGED
@@ -4,6 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  import json
6
6
  import sys
7
+ from importlib.metadata import version
7
8
  from pathlib import Path
8
9
  from typing import Annotated, Any
9
10
 
@@ -41,11 +42,28 @@ from tensors.safetensor import compute_sha256, get_base_name, read_safetensor_me
41
42
  # Key masking threshold
42
43
  MIN_KEY_LENGTH_FOR_MASKING = 8
43
44
 
45
+
46
+ def _version_callback(value: bool) -> None:
47
+ if value:
48
+ print(f"tsr {version('tensors')}")
49
+ raise typer.Exit
50
+
51
+
44
52
  app = typer.Typer(
45
53
  name="tsr",
46
54
  help="Read safetensor metadata, search and download CivitAI models.",
47
55
  no_args_is_help=True,
48
56
  )
57
+
58
+
59
+ @app.callback()
60
+ def _main(
61
+ _version: Annotated[
62
+ bool,
63
+ typer.Option("--version", "-V", callback=_version_callback, is_eager=True, help="Show version and exit."),
64
+ ] = False,
65
+ ) -> None:
66
+ """Read safetensor metadata, search and download CivitAI models."""
49
67
  console = Console()
50
68
 
51
69
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tensors
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Read safetensor metadata and fetch CivitAI model information
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: httpx>=0.27.0
@@ -1,10 +1,10 @@
1
1
  tensors/__init__.py,sha256=Mtf3EBB_VNGnVokXnGdelRR1vZuz30fHGFb2eywgr_M,567
2
2
  tensors/api.py,sha256=cSA7x2Dc_yaxwmVIVg19GTsn_J-0ChO_fd7cDNvX0dk,9634
3
- tensors/cli.py,sha256=LI2E8WvegRGNmnBA8Qc7oSJ09lwBDJQc6rXZTMWQut0,14301
3
+ tensors/cli.py,sha256=s5efFuBBDo6dvFfQSz6v58TM49vuDnvLe-hSzPr1AcQ,14750
4
4
  tensors/config.py,sha256=dqpycZfsPCDC6QbpwTJmIASbE4MDAewuqDGQZnT7WtI,4744
5
5
  tensors/display.py,sha256=SvOoVMT-tav_4xzGKcjdyhHi-pagzYQv0JzoCbrZjAA,12493
6
6
  tensors/safetensor.py,sha256=CGporkoEXWXrPBaYp3mZZ_rVCXbGFNCVOA4P1AqCBOI,2787
7
- tensors-0.1.4.dist-info/METADATA,sha256=jligKN-vHY1jRha3dRDzYAv-PPl59rW0oXBsIZTK0ak,2855
8
- tensors-0.1.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
9
- tensors-0.1.4.dist-info/entry_points.txt,sha256=wuNX2VdjEEyFmGaDk-iSxuecbHpixSrzHAWgfCkNUEY,37
10
- tensors-0.1.4.dist-info/RECORD,,
7
+ tensors-0.1.5.dist-info/METADATA,sha256=QFeN_oYv37pOmMRC7zDcTyFSwV804WDmblynhV7E4Bs,2855
8
+ tensors-0.1.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
9
+ tensors-0.1.5.dist-info/entry_points.txt,sha256=wuNX2VdjEEyFmGaDk-iSxuecbHpixSrzHAWgfCkNUEY,37
10
+ tensors-0.1.5.dist-info/RECORD,,