zpl-core 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.
zpl_core/__init__.py ADDED
@@ -0,0 +1,44 @@
1
+ """zpl-core — the ZPL label engine behind zebra-printer-mcp and zebra-printer-skill.
2
+
3
+ One package, three consumers:
4
+
5
+ zpl_core.builder label spec -> ZPL II (mm->dots, 28 symbologies, ^A@ TrueType)
6
+ zpl_core.knowledge command catalog, defaults, barcode/status/SGD tables
7
+ zpl_core.render ZPL -> PNG preview (extra: render)
8
+ zpl_core.photo photo of a label -> ZPL (extra: ocr)
9
+ zpl_core.transport TCP 9100 / Windows RAW / USB / preview
10
+ zpl_core.xlsx_batch one label per spreadsheet row (pure stdlib)
11
+
12
+ The core (build/validate/knowledge/transport/xlsx) is stdlib-only. Heavier paths
13
+ are optional extras so a caller that just wants ZPL does not pull 15 MB of OCR
14
+ models into a build::
15
+
16
+ pip install zpl-core # build, validate, send, status
17
+ pip install zpl-core[render] # + offline PNG preview
18
+ pip install zpl-core[ocr] # + photo -> ZPL (ships PP-OCRv4 weights)
19
+ pip install zpl-core[all]
20
+ """
21
+ from __future__ import annotations
22
+
23
+ import importlib
24
+
25
+ __version__ = "0.1.0"
26
+
27
+ from . import builder, catalog, knowledge, transport, xlsx_batch # noqa: E402,F401
28
+ from .paths import DATA_DIR, data_file # noqa: E402,F401
29
+
30
+ __all__ = [
31
+ "__version__", "builder", "catalog", "knowledge", "transport", "xlsx_batch",
32
+ "render", "photo", "ocr", "vision", "DATA_DIR", "data_file",
33
+ ]
34
+
35
+ # 重模块(Pillow / cv2 / onnxruntime)按需加载,import zpl_core 不拖时间
36
+ _LAZY = {"render", "photo", "ocr", "vision"}
37
+
38
+
39
+ def __getattr__(name: str):
40
+ if name in _LAZY:
41
+ module = importlib.import_module(f".{name}", __name__)
42
+ globals()[name] = module
43
+ return module
44
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")