buildwithtrace-converter 0.1.0__tar.gz

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 (27) hide show
  1. buildwithtrace_converter-0.1.0/.gitignore +23 -0
  2. buildwithtrace_converter-0.1.0/LICENSE +24 -0
  3. buildwithtrace_converter-0.1.0/PKG-INFO +106 -0
  4. buildwithtrace_converter-0.1.0/README.md +65 -0
  5. buildwithtrace_converter-0.1.0/pyproject.toml +49 -0
  6. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/__init__.py +23 -0
  7. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/common/__init__.py +18 -0
  8. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/common/local_vector_search.py +862 -0
  9. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/common/progress_reporter.py +103 -0
  10. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/common/sexp_helpers.py +125 -0
  11. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/common/sexp_parser.py +200 -0
  12. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/eeschema/__init__.py +22 -0
  13. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/eeschema/net_router.py +1220 -0
  14. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/eeschema/sexp_to_trace_json.py +2960 -0
  15. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/eeschema/trace.py +444 -0
  16. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/eeschema/trace_converter.py +948 -0
  17. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/eeschema/trace_json_to_sexp.py +4319 -0
  18. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/eeschema/trace_parser.py +2450 -0
  19. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/eeschema/trace_sch.ebnf +142 -0
  20. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/eeschema/wire_helpers.py +261 -0
  21. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/pcbnew/__init__.py +13 -0
  22. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/pcbnew/sexp_to_trace_json.py +1004 -0
  23. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/pcbnew/trace.py +426 -0
  24. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/pcbnew/trace_converter.py +656 -0
  25. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/pcbnew/trace_json_to_sexp.py +2363 -0
  26. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/pcbnew/trace_parser.py +1771 -0
  27. buildwithtrace_converter-0.1.0/src/buildwithtrace_converter/pcbnew/trace_pcb.ebnf +157 -0
@@ -0,0 +1,23 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ *.egg
6
+ .eggs/
7
+ build/
8
+ dist/
9
+ .venv/
10
+ venv/
11
+ env/
12
+ .pytest_cache/
13
+ .ruff_cache/
14
+ .mypy_cache/
15
+
16
+ # Heavy vector-search data must never be committed here (passed in by consumers)
17
+ src/buildwithtrace_converter/common/models/
18
+ src/buildwithtrace_converter/common/tokenizer/
19
+ *.onnx
20
+
21
+ # OS / editor
22
+ .DS_Store
23
+ *.swp
@@ -0,0 +1,24 @@
1
+ PROPRIETARY LICENSE
2
+
3
+ Copyright (C) 2025-2026 Trace Developers Team. All Rights Reserved.
4
+
5
+ This software and associated documentation files (the "Software") contained
6
+ in this directory and its subdirectories are proprietary and confidential.
7
+
8
+ RESTRICTIONS:
9
+ - You may NOT copy, modify, merge, publish, distribute, sublicense, or sell
10
+ copies of the Software.
11
+ - You may NOT use the Software for any commercial or non-commercial purpose
12
+ without explicit written permission from the copyright holders.
13
+ - You may NOT reverse engineer, decompile, or disassemble the Software.
14
+ - You may NOT create derivative works based on the Software.
15
+
16
+ This Software is provided for reference only as part of the Trace open-source
17
+ repository. The inclusion of this code in the repository does not grant any
18
+ license or rights to use, copy, or distribute it.
19
+
20
+ For licensing inquiries, contact: hello@buildwithtrace.com
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
24
+ DAMAGES OR OTHER LIABILITY ARISING FROM THE USE OF THIS SOFTWARE.
@@ -0,0 +1,106 @@
1
+ Metadata-Version: 2.4
2
+ Name: buildwithtrace-converter
3
+ Version: 0.1.0
4
+ Summary: Trace EDA converter: .trace_sch/.trace_pcb <-> KiCad s-expression, plus the trace_parser. Single source of truth for the CLI, backend, and desktop.
5
+ Author-email: Trace <hello@buildwithtrace.com>
6
+ License: PROPRIETARY LICENSE
7
+
8
+ Copyright (C) 2025-2026 Trace Developers Team. All Rights Reserved.
9
+
10
+ This software and associated documentation files (the "Software") contained
11
+ in this directory and its subdirectories are proprietary and confidential.
12
+
13
+ RESTRICTIONS:
14
+ - You may NOT copy, modify, merge, publish, distribute, sublicense, or sell
15
+ copies of the Software.
16
+ - You may NOT use the Software for any commercial or non-commercial purpose
17
+ without explicit written permission from the copyright holders.
18
+ - You may NOT reverse engineer, decompile, or disassemble the Software.
19
+ - You may NOT create derivative works based on the Software.
20
+
21
+ This Software is provided for reference only as part of the Trace open-source
22
+ repository. The inclusion of this code in the repository does not grant any
23
+ license or rights to use, copy, or distribute it.
24
+
25
+ For licensing inquiries, contact: hello@buildwithtrace.com
26
+
27
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ IMPLIED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
29
+ DAMAGES OR OTHER LIABILITY ARISING FROM THE USE OF THIS SOFTWARE.
30
+ License-File: LICENSE
31
+ Keywords: converter,eda,kicad,pcb,schematic,trace
32
+ Requires-Python: >=3.9
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest>=7.0; extra == 'dev'
35
+ Requires-Dist: ruff>=0.1; extra == 'dev'
36
+ Provides-Extra: vectorsearch
37
+ Requires-Dist: numpy>=1.24; extra == 'vectorsearch'
38
+ Requires-Dist: onnxruntime>=1.16; extra == 'vectorsearch'
39
+ Requires-Dist: tokenizers>=0.15; extra == 'vectorsearch'
40
+ Description-Content-Type: text/markdown
41
+
42
+ # buildwithtrace-converter
43
+
44
+ The Trace EDA converter, extracted into a single installable package so the CLI,
45
+ backend, and desktop app stop carrying their own copies.
46
+
47
+ It converts between Trace's intermediate `.trace_sch` / `.trace_pcb` format and
48
+ KiCad's native `.kicad_sch` / `.kicad_pcb` s-expression format (both directions),
49
+ and exposes the `trace_parser` used to read the intermediate format.
50
+
51
+ - **Package (PyPI/dist) name:** `buildwithtrace-converter`
52
+ - **Import root:** `buildwithtrace_converter` (a self-contained top-level — deliberately NOT a `buildwithtrace.*` namespace, to avoid colliding with the CLI's `buildwithtrace` package and the backend's vendored `buildwithtrace.altium`)
53
+ - **GitHub:** `buildwithtrace/converter` (org, canonical) / `elcruzo/trace-converter` (personal)
54
+
55
+ ## Install
56
+
57
+ ```bash
58
+ # core (pure stdlib, no deps)
59
+ pip install buildwithtrace-converter
60
+
61
+ # with the optional vector-search helper (numpy / onnxruntime / tokenizers)
62
+ pip install "buildwithtrace-converter[vectorsearch]"
63
+ ```
64
+
65
+ Pre-publish (private), install from git or a local checkout:
66
+
67
+ ```bash
68
+ pip install "buildwithtrace-converter @ git+https://github.com/buildwithtrace/converter@main"
69
+ pip install -e ../converter # local dev
70
+ ```
71
+
72
+ ## Usage
73
+
74
+ ```python
75
+ from buildwithtrace_converter.eeschema.trace_parser import parse_trace_sch
76
+ from buildwithtrace_converter.eeschema.trace_json_to_sexp import trace_json_to_sexp
77
+ from buildwithtrace_converter.eeschema.sexp_to_trace_json import sexp_to_trace_json
78
+ from buildwithtrace_converter.pcbnew.trace_parser import parse_trace_pcb
79
+ ```
80
+
81
+ The unified file CLI (used by the desktop via subprocess):
82
+
83
+ ```bash
84
+ python -m buildwithtrace_converter.eeschema.trace IN OUT -f trace_sch -t kicad_sch
85
+ python -m buildwithtrace_converter.pcbnew.trace IN OUT -f trace_pcb -t kicad_pcb
86
+ ```
87
+
88
+ ## Notes
89
+
90
+ - **Core is pure-stdlib** (no runtime dependencies). Only
91
+ `common/local_vector_search.py` needs the `[vectorsearch]` extra, and the
92
+ embedding model + tokenizer are NOT bundled — pass their paths in.
93
+ - **Source of truth.** Edit here. Consumers (`trace-cli`, `backend`, and later the
94
+ `Trace` desktop) depend on this package; do not re-fork the sources.
95
+ - **Drift is enforced.** `scripts/verify_sync.py` diffs every shared converter source
96
+ against the bundled copies and exits non-zero on drift. Run it locally after editing
97
+ (it defaults to the sibling `trace-cli` + `Trace/trace` bundles):
98
+
99
+ ```bash
100
+ python3 scripts/verify_sync.py
101
+ ```
102
+
103
+ It is also a CI gate: the `converter-sync` job in `trace-cli/.github/workflows/ci.yml`
104
+ clones this repo and checks the CLI bundle on every PR.
105
+ - **License:** see `LICENSE` (proprietary — distribute via a private index or git,
106
+ not public PyPI).
@@ -0,0 +1,65 @@
1
+ # buildwithtrace-converter
2
+
3
+ The Trace EDA converter, extracted into a single installable package so the CLI,
4
+ backend, and desktop app stop carrying their own copies.
5
+
6
+ It converts between Trace's intermediate `.trace_sch` / `.trace_pcb` format and
7
+ KiCad's native `.kicad_sch` / `.kicad_pcb` s-expression format (both directions),
8
+ and exposes the `trace_parser` used to read the intermediate format.
9
+
10
+ - **Package (PyPI/dist) name:** `buildwithtrace-converter`
11
+ - **Import root:** `buildwithtrace_converter` (a self-contained top-level — deliberately NOT a `buildwithtrace.*` namespace, to avoid colliding with the CLI's `buildwithtrace` package and the backend's vendored `buildwithtrace.altium`)
12
+ - **GitHub:** `buildwithtrace/converter` (org, canonical) / `elcruzo/trace-converter` (personal)
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ # core (pure stdlib, no deps)
18
+ pip install buildwithtrace-converter
19
+
20
+ # with the optional vector-search helper (numpy / onnxruntime / tokenizers)
21
+ pip install "buildwithtrace-converter[vectorsearch]"
22
+ ```
23
+
24
+ Pre-publish (private), install from git or a local checkout:
25
+
26
+ ```bash
27
+ pip install "buildwithtrace-converter @ git+https://github.com/buildwithtrace/converter@main"
28
+ pip install -e ../converter # local dev
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ ```python
34
+ from buildwithtrace_converter.eeschema.trace_parser import parse_trace_sch
35
+ from buildwithtrace_converter.eeschema.trace_json_to_sexp import trace_json_to_sexp
36
+ from buildwithtrace_converter.eeschema.sexp_to_trace_json import sexp_to_trace_json
37
+ from buildwithtrace_converter.pcbnew.trace_parser import parse_trace_pcb
38
+ ```
39
+
40
+ The unified file CLI (used by the desktop via subprocess):
41
+
42
+ ```bash
43
+ python -m buildwithtrace_converter.eeschema.trace IN OUT -f trace_sch -t kicad_sch
44
+ python -m buildwithtrace_converter.pcbnew.trace IN OUT -f trace_pcb -t kicad_pcb
45
+ ```
46
+
47
+ ## Notes
48
+
49
+ - **Core is pure-stdlib** (no runtime dependencies). Only
50
+ `common/local_vector_search.py` needs the `[vectorsearch]` extra, and the
51
+ embedding model + tokenizer are NOT bundled — pass their paths in.
52
+ - **Source of truth.** Edit here. Consumers (`trace-cli`, `backend`, and later the
53
+ `Trace` desktop) depend on this package; do not re-fork the sources.
54
+ - **Drift is enforced.** `scripts/verify_sync.py` diffs every shared converter source
55
+ against the bundled copies and exits non-zero on drift. Run it locally after editing
56
+ (it defaults to the sibling `trace-cli` + `Trace/trace` bundles):
57
+
58
+ ```bash
59
+ python3 scripts/verify_sync.py
60
+ ```
61
+
62
+ It is also a CI gate: the `converter-sync` job in `trace-cli/.github/workflows/ci.yml`
63
+ clones this repo and checks the CLI bundle on every PR.
64
+ - **License:** see `LICENSE` (proprietary — distribute via a private index or git,
65
+ not public PyPI).
@@ -0,0 +1,49 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "buildwithtrace-converter"
7
+ version = "0.1.0"
8
+ description = "Trace EDA converter: .trace_sch/.trace_pcb <-> KiCad s-expression, plus the trace_parser. Single source of truth for the CLI, backend, and desktop."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = { file = "LICENSE" }
12
+ authors = [{ name = "Trace", email = "hello@buildwithtrace.com" }]
13
+ keywords = ["eda", "kicad", "pcb", "schematic", "converter", "trace"]
14
+ # Core conversion (trace_parser, trace_json_to_sexp, sexp_to_trace_json,
15
+ # trace_converter, sexp_helpers/parser, net_router, wire_helpers,
16
+ # progress_reporter) is PURE STDLIB -- no runtime dependencies.
17
+ dependencies = []
18
+
19
+ [project.optional-dependencies]
20
+ # Only needed for buildwithtrace_converter.common.local_vector_search.
21
+ # The embedding model + tokenizer are NOT shipped here; pass their paths in.
22
+ vectorsearch = [
23
+ "numpy>=1.24",
24
+ "onnxruntime>=1.16",
25
+ "tokenizers>=0.15",
26
+ ]
27
+ dev = [
28
+ "pytest>=7.0",
29
+ "ruff>=0.1",
30
+ ]
31
+
32
+ [tool.hatch.build.targets.wheel]
33
+ packages = ["src/buildwithtrace_converter"]
34
+
35
+ [tool.hatch.build.targets.sdist]
36
+ include = ["src/buildwithtrace_converter", "README.md", "LICENSE"]
37
+
38
+ # Grammar files (.ebnf) live inside the package dir and are included by default;
39
+ # explicitly exclude caches and any heavy data dirs that must never ship here.
40
+ [tool.hatch.build]
41
+ exclude = [
42
+ "**/__pycache__",
43
+ "**/*.pyc",
44
+ "src/buildwithtrace_converter/common/models",
45
+ "src/buildwithtrace_converter/common/tokenizer",
46
+ ]
47
+
48
+ [tool.ruff]
49
+ line-length = 120
@@ -0,0 +1,23 @@
1
+ """buildwithtrace-converter — the Trace EDA converter, single source of truth.
2
+
3
+ Converts between Trace's intermediate ``.trace_sch`` / ``.trace_pcb`` format and
4
+ KiCad's native ``.kicad_sch`` / ``.kicad_pcb`` s-expression format, in both
5
+ directions, plus the ``trace_parser`` used to read the intermediate format.
6
+
7
+ This package is the canonical home of the converter. The Trace CLI, the backend,
8
+ and (eventually) the desktop app all consume it instead of keeping their own copy.
9
+
10
+ Core conversion is pure-stdlib. The optional ``[vectorsearch]`` extra
11
+ (numpy / onnxruntime / tokenizers) is only needed for
12
+ ``buildwithtrace_converter.common.local_vector_search``; the embedding model and
13
+ tokenizer are NOT shipped in the package — pass their paths from the consumer.
14
+
15
+ Public entry points:
16
+ from buildwithtrace_converter.eeschema.trace_parser import parse_trace_sch
17
+ from buildwithtrace_converter.eeschema.trace_json_to_sexp import trace_json_to_sexp
18
+ from buildwithtrace_converter.eeschema.sexp_to_trace_json import sexp_to_trace_json
19
+ from buildwithtrace_converter.pcbnew.trace_parser import parse_trace_pcb
20
+ # ... and the pcbnew equivalents.
21
+ """
22
+
23
+ __version__ = "0.1.0"
@@ -0,0 +1,18 @@
1
+ #
2
+ # This program source code file is part of Trace, an AI-native PCB design application.
3
+ #
4
+ # Copyright (C) 2025-2026 Trace Developers Team. All Rights Reserved.
5
+ #
6
+ # PROPRIETARY AND CONFIDENTIAL. This file is part of the proprietary `trace/`
7
+ # modules (see LICENSE in this directory). You may NOT copy, modify, distribute,
8
+ # sublicense, sell, reverse-engineer, or create derivative works without explicit
9
+ # written permission. Provided for reference only as part of the Trace repository.
10
+ #
11
+ # For licensing inquiries: hello@buildwithtrace.com
12
+
13
+ """
14
+ Common utilities for trace converters.
15
+
16
+ This package contains shared S-expression parsing and helper functions
17
+ used by both eeschema and pcbnew converters.
18
+ """