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.
- lvkit/__init__.py +55 -0
- lvkit/_data.py +24 -0
- lvkit/cli.py +980 -0
- lvkit/codegen/README.md +147 -0
- lvkit/codegen/__init__.py +36 -0
- lvkit/codegen/ast_optimizer.py +436 -0
- lvkit/codegen/ast_utils.py +241 -0
- lvkit/codegen/builder.py +754 -0
- lvkit/codegen/class_builder.py +775 -0
- lvkit/codegen/condition_builder.py +316 -0
- lvkit/codegen/context.py +576 -0
- lvkit/codegen/dataflow.py +241 -0
- lvkit/codegen/error_handler.py +297 -0
- lvkit/codegen/expressions.py +202 -0
- lvkit/codegen/fragment.py +54 -0
- lvkit/codegen/function.py +307 -0
- lvkit/codegen/imports.py +132 -0
- lvkit/codegen/nodes/__init__.py +102 -0
- lvkit/codegen/nodes/base.py +50 -0
- lvkit/codegen/nodes/case.py +345 -0
- lvkit/codegen/nodes/compound.py +159 -0
- lvkit/codegen/nodes/constant.py +33 -0
- lvkit/codegen/nodes/invoke_node.py +83 -0
- lvkit/codegen/nodes/loop.py +744 -0
- lvkit/codegen/nodes/nmux.py +224 -0
- lvkit/codegen/nodes/primitive.py +673 -0
- lvkit/codegen/nodes/printf.py +70 -0
- lvkit/codegen/nodes/property_node.py +106 -0
- lvkit/codegen/nodes/sequence.py +65 -0
- lvkit/codegen/nodes/subvi.py +789 -0
- lvkit/codegen/stubs.py +184 -0
- lvkit/codegen/unresolved.py +156 -0
- lvkit/data/drivers/_index.json +15 -0
- lvkit/data/drivers/daqmx.json +2708 -0
- lvkit/data/drivers/nidcpower.json +545 -0
- lvkit/data/drivers/nidigital.json +830 -0
- lvkit/data/drivers/nidmm.json +620 -0
- lvkit/data/drivers/nifgen.json +490 -0
- lvkit/data/drivers/niscope.json +560 -0
- lvkit/data/drivers/niswitch.json +475 -0
- lvkit/data/drivers/serial.json +170 -0
- lvkit/data/drivers/visa.json +542 -0
- lvkit/data/labview_error_codes.json +1318 -0
- lvkit/data/openg/_index.json +12 -0
- lvkit/data/openg/array.json +6951 -0
- lvkit/data/openg/file.json +876 -0
- lvkit/data/openg/string.json +146 -0
- lvkit/data/openg/time.json +98 -0
- lvkit/data/openg/variant.json +33 -0
- lvkit/data/primitives-from-pdf.json +8452 -0
- lvkit/data/primitives.json +3166 -0
- lvkit/data/vilib/_index.json +19 -0
- lvkit/data/vilib/_pending_terminals.json +1391 -0
- lvkit/data/vilib/_types.json +24 -0
- lvkit/data/vilib/application-control.json +5408 -0
- lvkit/data/vilib/array.json +2071 -0
- lvkit/data/vilib/boolean.json +704 -0
- lvkit/data/vilib/cluster.json +776 -0
- lvkit/data/vilib/comparison.json +2388 -0
- lvkit/data/vilib/error-handling.json +2274 -0
- lvkit/data/vilib/file-io.json +4733 -0
- lvkit/data/vilib/numeric.json +1538 -0
- lvkit/data/vilib/other.json +87782 -0
- lvkit/data/vilib/string.json +3582 -0
- lvkit/data/vilib/structures.json +1040 -0
- lvkit/data/vilib/variant.json +1343 -0
- lvkit/docs/__init__.py +1 -0
- lvkit/docs/generate.py +400 -0
- lvkit/docs/html_generator.py +853 -0
- lvkit/docs/template.css +398 -0
- lvkit/docs/utils.py +109 -0
- lvkit/extractor.py +98 -0
- lvkit/graph/__init__.py +10 -0
- lvkit/graph/analysis.py +158 -0
- lvkit/graph/construction.py +1221 -0
- lvkit/graph/core.py +321 -0
- lvkit/graph/describe.py +493 -0
- lvkit/graph/diff.py +387 -0
- lvkit/graph/flowchart.py +281 -0
- lvkit/graph/loading.py +716 -0
- lvkit/graph/models.py +420 -0
- lvkit/graph/operations.py +446 -0
- lvkit/graph/queries.py +813 -0
- lvkit/labview_error.py +146 -0
- lvkit/labview_error_codes.py +48 -0
- lvkit/mcp/__init__.py +7 -0
- lvkit/mcp/schemas.py +239 -0
- lvkit/mcp/server.py +647 -0
- lvkit/mcp/tools.py +204 -0
- lvkit/models.py +388 -0
- lvkit/parser/__init__.py +96 -0
- lvkit/parser/constants.py +158 -0
- lvkit/parser/defaults.py +117 -0
- lvkit/parser/flags.py +26 -0
- lvkit/parser/front_panel.py +257 -0
- lvkit/parser/metadata.py +290 -0
- lvkit/parser/models.py +406 -0
- lvkit/parser/naming.py +77 -0
- lvkit/parser/node_types.py +600 -0
- lvkit/parser/nodes/__init__.py +16 -0
- lvkit/parser/nodes/base.py +80 -0
- lvkit/parser/nodes/case.py +389 -0
- lvkit/parser/nodes/constant.py +55 -0
- lvkit/parser/nodes/loop.py +134 -0
- lvkit/parser/nodes/sequence.py +150 -0
- lvkit/parser/type_mapping.py +387 -0
- lvkit/parser/type_resolution.py +254 -0
- lvkit/parser/utils.py +124 -0
- lvkit/parser/vi.py +1033 -0
- lvkit/pipeline.py +683 -0
- lvkit/primitive_resolver.py +633 -0
- lvkit/project_store.py +480 -0
- lvkit/py.typed +0 -0
- lvkit/skill_templates/__init__.py +15 -0
- lvkit/skill_templates/lvkit-convert/SKILL.md +141 -0
- lvkit/skill_templates/lvkit-describe/SKILL.md +108 -0
- lvkit/skill_templates/lvkit-idiomatic/SKILL.md +85 -0
- lvkit/skill_templates/lvkit-resolve-primitive/SKILL.md +275 -0
- lvkit/skill_templates/lvkit-resolve-vilib/SKILL.md +146 -0
- lvkit/structure.py +788 -0
- lvkit/terminal_collector.py +295 -0
- lvkit/type_defaults.py +195 -0
- lvkit/vilib_resolver.py +1160 -0
- lvkit-0.1.0.dist-info/METADATA +199 -0
- lvkit-0.1.0.dist-info/RECORD +128 -0
- lvkit-0.1.0.dist-info/WHEEL +4 -0
- lvkit-0.1.0.dist-info/entry_points.txt +3 -0
- 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
|