lvkit 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.
Files changed (128) hide show
  1. lvkit/__init__.py +55 -0
  2. lvkit/_data.py +24 -0
  3. lvkit/cli.py +980 -0
  4. lvkit/codegen/README.md +147 -0
  5. lvkit/codegen/__init__.py +36 -0
  6. lvkit/codegen/ast_optimizer.py +436 -0
  7. lvkit/codegen/ast_utils.py +241 -0
  8. lvkit/codegen/builder.py +754 -0
  9. lvkit/codegen/class_builder.py +775 -0
  10. lvkit/codegen/condition_builder.py +316 -0
  11. lvkit/codegen/context.py +576 -0
  12. lvkit/codegen/dataflow.py +241 -0
  13. lvkit/codegen/error_handler.py +297 -0
  14. lvkit/codegen/expressions.py +202 -0
  15. lvkit/codegen/fragment.py +54 -0
  16. lvkit/codegen/function.py +307 -0
  17. lvkit/codegen/imports.py +132 -0
  18. lvkit/codegen/nodes/__init__.py +102 -0
  19. lvkit/codegen/nodes/base.py +50 -0
  20. lvkit/codegen/nodes/case.py +345 -0
  21. lvkit/codegen/nodes/compound.py +159 -0
  22. lvkit/codegen/nodes/constant.py +33 -0
  23. lvkit/codegen/nodes/invoke_node.py +83 -0
  24. lvkit/codegen/nodes/loop.py +744 -0
  25. lvkit/codegen/nodes/nmux.py +224 -0
  26. lvkit/codegen/nodes/primitive.py +673 -0
  27. lvkit/codegen/nodes/printf.py +70 -0
  28. lvkit/codegen/nodes/property_node.py +106 -0
  29. lvkit/codegen/nodes/sequence.py +65 -0
  30. lvkit/codegen/nodes/subvi.py +789 -0
  31. lvkit/codegen/stubs.py +184 -0
  32. lvkit/codegen/unresolved.py +156 -0
  33. lvkit/data/drivers/_index.json +15 -0
  34. lvkit/data/drivers/daqmx.json +2708 -0
  35. lvkit/data/drivers/nidcpower.json +545 -0
  36. lvkit/data/drivers/nidigital.json +830 -0
  37. lvkit/data/drivers/nidmm.json +620 -0
  38. lvkit/data/drivers/nifgen.json +490 -0
  39. lvkit/data/drivers/niscope.json +560 -0
  40. lvkit/data/drivers/niswitch.json +475 -0
  41. lvkit/data/drivers/serial.json +170 -0
  42. lvkit/data/drivers/visa.json +542 -0
  43. lvkit/data/labview_error_codes.json +1318 -0
  44. lvkit/data/openg/_index.json +12 -0
  45. lvkit/data/openg/array.json +6951 -0
  46. lvkit/data/openg/file.json +876 -0
  47. lvkit/data/openg/string.json +146 -0
  48. lvkit/data/openg/time.json +98 -0
  49. lvkit/data/openg/variant.json +33 -0
  50. lvkit/data/primitives-from-pdf.json +8452 -0
  51. lvkit/data/primitives.json +3166 -0
  52. lvkit/data/vilib/_index.json +19 -0
  53. lvkit/data/vilib/_pending_terminals.json +1391 -0
  54. lvkit/data/vilib/_types.json +24 -0
  55. lvkit/data/vilib/application-control.json +5408 -0
  56. lvkit/data/vilib/array.json +2071 -0
  57. lvkit/data/vilib/boolean.json +704 -0
  58. lvkit/data/vilib/cluster.json +776 -0
  59. lvkit/data/vilib/comparison.json +2388 -0
  60. lvkit/data/vilib/error-handling.json +2274 -0
  61. lvkit/data/vilib/file-io.json +4733 -0
  62. lvkit/data/vilib/numeric.json +1538 -0
  63. lvkit/data/vilib/other.json +87782 -0
  64. lvkit/data/vilib/string.json +3582 -0
  65. lvkit/data/vilib/structures.json +1040 -0
  66. lvkit/data/vilib/variant.json +1343 -0
  67. lvkit/docs/__init__.py +1 -0
  68. lvkit/docs/generate.py +400 -0
  69. lvkit/docs/html_generator.py +853 -0
  70. lvkit/docs/template.css +398 -0
  71. lvkit/docs/utils.py +109 -0
  72. lvkit/extractor.py +98 -0
  73. lvkit/graph/__init__.py +10 -0
  74. lvkit/graph/analysis.py +158 -0
  75. lvkit/graph/construction.py +1221 -0
  76. lvkit/graph/core.py +321 -0
  77. lvkit/graph/describe.py +493 -0
  78. lvkit/graph/diff.py +387 -0
  79. lvkit/graph/flowchart.py +281 -0
  80. lvkit/graph/loading.py +716 -0
  81. lvkit/graph/models.py +420 -0
  82. lvkit/graph/operations.py +446 -0
  83. lvkit/graph/queries.py +813 -0
  84. lvkit/labview_error.py +146 -0
  85. lvkit/labview_error_codes.py +48 -0
  86. lvkit/mcp/__init__.py +7 -0
  87. lvkit/mcp/schemas.py +239 -0
  88. lvkit/mcp/server.py +647 -0
  89. lvkit/mcp/tools.py +204 -0
  90. lvkit/models.py +388 -0
  91. lvkit/parser/__init__.py +96 -0
  92. lvkit/parser/constants.py +158 -0
  93. lvkit/parser/defaults.py +117 -0
  94. lvkit/parser/flags.py +26 -0
  95. lvkit/parser/front_panel.py +257 -0
  96. lvkit/parser/metadata.py +290 -0
  97. lvkit/parser/models.py +406 -0
  98. lvkit/parser/naming.py +77 -0
  99. lvkit/parser/node_types.py +600 -0
  100. lvkit/parser/nodes/__init__.py +16 -0
  101. lvkit/parser/nodes/base.py +80 -0
  102. lvkit/parser/nodes/case.py +389 -0
  103. lvkit/parser/nodes/constant.py +55 -0
  104. lvkit/parser/nodes/loop.py +134 -0
  105. lvkit/parser/nodes/sequence.py +150 -0
  106. lvkit/parser/type_mapping.py +387 -0
  107. lvkit/parser/type_resolution.py +254 -0
  108. lvkit/parser/utils.py +124 -0
  109. lvkit/parser/vi.py +1033 -0
  110. lvkit/pipeline.py +683 -0
  111. lvkit/primitive_resolver.py +633 -0
  112. lvkit/project_store.py +480 -0
  113. lvkit/py.typed +0 -0
  114. lvkit/skill_templates/__init__.py +15 -0
  115. lvkit/skill_templates/lvkit-convert/SKILL.md +141 -0
  116. lvkit/skill_templates/lvkit-describe/SKILL.md +108 -0
  117. lvkit/skill_templates/lvkit-idiomatic/SKILL.md +85 -0
  118. lvkit/skill_templates/lvkit-resolve-primitive/SKILL.md +275 -0
  119. lvkit/skill_templates/lvkit-resolve-vilib/SKILL.md +146 -0
  120. lvkit/structure.py +788 -0
  121. lvkit/terminal_collector.py +295 -0
  122. lvkit/type_defaults.py +195 -0
  123. lvkit/vilib_resolver.py +1160 -0
  124. lvkit-0.1.0.dist-info/METADATA +199 -0
  125. lvkit-0.1.0.dist-info/RECORD +128 -0
  126. lvkit-0.1.0.dist-info/WHEEL +4 -0
  127. lvkit-0.1.0.dist-info/entry_points.txt +3 -0
  128. lvkit-0.1.0.dist-info/licenses/LICENSE +201 -0
lvkit/__init__.py ADDED
@@ -0,0 +1,55 @@
1
+ """lvkit - Convert LabVIEW VIs to Python code."""
2
+
3
+ __version__ = "0.1.0"
4
+
5
+ from .graph.models import Constant as GraphConstant
6
+ from .graph.models import Wire as GraphWire
7
+ from .models import Operation, Terminal, Tunnel
8
+ from .parser import (
9
+ ParsedBlockDiagram,
10
+ ParsedConnectorPane,
11
+ ParsedConnectorPaneSlot,
12
+ ParsedConstant,
13
+ ParsedFPControl,
14
+ ParsedFrontPanel,
15
+ ParsedNode,
16
+ ParsedVI,
17
+ ParsedVIMetadata,
18
+ ParsedWire,
19
+ parse_vi,
20
+ )
21
+ from .structure import (
22
+ LVClass,
23
+ LVLibrary,
24
+ LVMethod,
25
+ discover_project_structure,
26
+ generate_python_structure_plan,
27
+ parse_lvclass,
28
+ parse_lvlib,
29
+ )
30
+
31
+ __all__ = [
32
+ "parse_vi",
33
+ "ParsedVI",
34
+ "ParsedVIMetadata",
35
+ "ParsedBlockDiagram",
36
+ "ParsedConnectorPane",
37
+ "ParsedConnectorPaneSlot",
38
+ "ParsedNode",
39
+ "ParsedWire",
40
+ "ParsedConstant",
41
+ "parse_lvclass",
42
+ "parse_lvlib",
43
+ "discover_project_structure",
44
+ "generate_python_structure_plan",
45
+ "LVClass",
46
+ "LVLibrary",
47
+ "LVMethod",
48
+ "ParsedFrontPanel",
49
+ "ParsedFPControl",
50
+ "Terminal",
51
+ "Operation",
52
+ "Tunnel",
53
+ "GraphConstant",
54
+ "GraphWire",
55
+ ]
lvkit/_data.py ADDED
@@ -0,0 +1,24 @@
1
+ """Single source of truth for the bundled data directory.
2
+
3
+ lvkit ships JSON mappings (primitives, vi.lib, openg, drivers, enums,
4
+ error codes) as package data under ``src/lvkit/data/``. This module is
5
+ the one place where that location is computed — every resolver and
6
+ loader imports ``data_dir()`` instead of recomputing the path.
7
+
8
+ Centralizing this means a future move (rename, restructure, or
9
+ switch to importlib.resources) only touches one file.
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from pathlib import Path
15
+
16
+ # The bundled data directory lives next to this module inside the
17
+ # installed package, so a single ``Path(__file__).parent`` works for
18
+ # both editable installs (``pip install -e``) and wheel installs.
19
+ _DATA_DIR = Path(__file__).parent / "data"
20
+
21
+
22
+ def data_dir() -> Path:
23
+ """Return the bundled data directory path."""
24
+ return _DATA_DIR