kicad-python 0.5.0__tar.gz → 0.7.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.
- kicad_python-0.5.0/README.md → kicad_python-0.7.0/PKG-INFO +44 -0
- kicad_python-0.5.0/PKG-INFO → kicad_python-0.7.0/README.md +21 -22
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/board.py +160 -5
- kicad_python-0.7.0/build/lib/kipy/board_jobs.py +1557 -0
- kicad_python-0.7.0/build/lib/kipy/board_rules.py +1096 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/board_types.py +341 -11
- {kicad_python-0.5.0 → kicad_python-0.7.0/build/lib}/kipy/common_types.py +12 -14
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/geometry.py +73 -5
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/kicad_api_version.py +1 -1
- kicad_python-0.7.0/build/lib/kipy/packaging/__init__.py +28 -0
- kicad_python-0.7.0/build/lib/kipy/packaging/__main__.py +24 -0
- kicad_python-0.7.0/build/lib/kipy/packaging/cli.py +64 -0
- kicad_python-0.7.0/build/lib/kipy/packaging/types.py +81 -0
- kicad_python-0.7.0/build/lib/kipy/packaging/validate.py +387 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0/build/lib}/kipy/project.py +5 -1
- {kicad_python-0.5.0 → kicad_python-0.7.0/build/lib}/kipy/project_types.py +3 -1
- kicad_python-0.7.0/build/lib/kipy/proto/board/board_commands_pb2.py +111 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0/build/lib}/kipy/proto/board/board_commands_pb2.pyi +164 -7
- kicad_python-0.7.0/build/lib/kipy/proto/board/board_jobs_pb2.py +86 -0
- kicad_python-0.7.0/build/lib/kipy/proto/board/board_jobs_pb2.pyi +1169 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/board/board_pb2.py +1 -1
- kicad_python-0.7.0/build/lib/kipy/proto/board/board_types_pb2.py +176 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/board/board_types_pb2.pyi +452 -28
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/common/commands/base_commands_pb2.py +1 -1
- kicad_python-0.7.0/build/lib/kipy/proto/common/commands/editor_commands_pb2.py +113 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0/build/lib}/kipy/proto/common/commands/editor_commands_pb2.pyi +48 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/common/commands/project_commands_pb2.py +1 -1
- {kicad_python-0.5.0 → kicad_python-0.7.0/build/lib}/kipy/proto/common/envelope_pb2.py +1 -1
- kicad_python-0.7.0/build/lib/kipy/proto/common/types/base_types_pb2.py +106 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/common/types/base_types_pb2.pyi +63 -3
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/common/types/enums_pb2.py +9 -9
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/common/types/enums_pb2.pyi +4 -0
- kicad_python-0.7.0/build/lib/kipy/proto/common/types/generators_pb2.py +28 -0
- kicad_python-0.7.0/build/lib/kipy/proto/common/types/generators_pb2.pyi +182 -0
- kicad_python-0.7.0/build/lib/kipy/proto/common/types/jobs_pb2.py +21 -0
- kicad_python-0.7.0/build/lib/kipy/proto/common/types/jobs_pb2.pyi +99 -0
- kicad_python-0.7.0/build/lib/kipy/proto/common/types/project_settings_pb2.py +31 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/common/types/project_settings_pb2.pyi +10 -3
- kicad_python-0.7.0/build/lib/kipy/proto/common/types/wizards_pb2.py +41 -0
- kicad_python-0.7.0/build/lib/kipy/proto/common/types/wizards_pb2.pyi +365 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/schematic/schematic_commands_pb2.py +1 -1
- kicad_python-0.7.0/build/lib/kipy/proto/schematic/schematic_jobs_pb2.py +41 -0
- kicad_python-0.7.0/build/lib/kipy/proto/schematic/schematic_jobs_pb2.pyi +393 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/schematic/schematic_types_pb2.py +1 -1
- kicad_python-0.7.0/build/lib/kipy/schematic.py +326 -0
- kicad_python-0.7.0/build/lib/kipy/schematic_types.py +1759 -0
- kicad_python-0.7.0/build/lib/kipy/server.py +303 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0/build/lib}/kipy/util/proto.py +1 -0
- kicad_python-0.7.0/build/lib/kipy/wizards.py +798 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/board.py +160 -5
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/board_types.py +341 -11
- {kicad_python-0.5.0/build/lib → kicad_python-0.7.0}/kipy/common_types.py +12 -14
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/geometry.py +73 -5
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/kicad_api_version.py +1 -1
- kicad_python-0.7.0/kipy/packaging/__init__.py +28 -0
- kicad_python-0.7.0/kipy/packaging/__main__.py +24 -0
- kicad_python-0.7.0/kipy/packaging/cli.py +64 -0
- kicad_python-0.7.0/kipy/packaging/schemas/__init__.py +0 -0
- kicad_python-0.7.0/kipy/packaging/schemas/api.v1.schema.json +125 -0
- kicad_python-0.7.0/kipy/packaging/schemas/pcm.v1.schema.json +397 -0
- kicad_python-0.7.0/kipy/packaging/schemas/pcm.v2.schema.json +304 -0
- kicad_python-0.7.0/kipy/packaging/types.py +81 -0
- kicad_python-0.7.0/kipy/packaging/validate.py +387 -0
- {kicad_python-0.5.0/build/lib → kicad_python-0.7.0}/kipy/project.py +5 -1
- {kicad_python-0.5.0/build/lib → kicad_python-0.7.0}/kipy/project_types.py +3 -1
- kicad_python-0.7.0/kipy/proto/board/board_commands_pb2.py +111 -0
- {kicad_python-0.5.0/build/lib → kicad_python-0.7.0}/kipy/proto/board/board_commands_pb2.pyi +164 -7
- kicad_python-0.7.0/kipy/proto/board/board_jobs_pb2.py +86 -0
- kicad_python-0.7.0/kipy/proto/board/board_jobs_pb2.pyi +1169 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/board/board_pb2.py +1 -1
- kicad_python-0.7.0/kipy/proto/board/board_types_pb2.py +176 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/board/board_types_pb2.pyi +452 -28
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/common/commands/base_commands_pb2.py +1 -1
- kicad_python-0.7.0/kipy/proto/common/commands/editor_commands_pb2.py +113 -0
- {kicad_python-0.5.0/build/lib → kicad_python-0.7.0}/kipy/proto/common/commands/editor_commands_pb2.pyi +48 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/common/commands/project_commands_pb2.py +1 -1
- {kicad_python-0.5.0/build/lib → kicad_python-0.7.0}/kipy/proto/common/envelope_pb2.py +1 -1
- kicad_python-0.7.0/kipy/proto/common/types/base_types_pb2.py +106 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/common/types/base_types_pb2.pyi +63 -3
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/common/types/enums_pb2.py +9 -9
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/common/types/enums_pb2.pyi +4 -0
- kicad_python-0.7.0/kipy/proto/common/types/generators_pb2.py +28 -0
- kicad_python-0.7.0/kipy/proto/common/types/generators_pb2.pyi +182 -0
- kicad_python-0.7.0/kipy/proto/common/types/jobs_pb2.py +21 -0
- kicad_python-0.7.0/kipy/proto/common/types/jobs_pb2.pyi +99 -0
- kicad_python-0.7.0/kipy/proto/common/types/project_settings_pb2.py +31 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/common/types/project_settings_pb2.pyi +10 -3
- kicad_python-0.7.0/kipy/proto/common/types/wizards_pb2.py +41 -0
- kicad_python-0.7.0/kipy/proto/common/types/wizards_pb2.pyi +365 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/schematic/schematic_commands_pb2.py +1 -1
- kicad_python-0.7.0/kipy/proto/schematic/schematic_jobs_pb2.py +41 -0
- kicad_python-0.7.0/kipy/proto/schematic/schematic_jobs_pb2.pyi +393 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/schematic/schematic_types_pb2.py +1 -1
- kicad_python-0.7.0/kipy/py.typed +0 -0
- {kicad_python-0.5.0/build/lib → kicad_python-0.7.0}/kipy/util/proto.py +1 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/pyproject.toml +12 -4
- {kicad_python-0.5.0 → kicad_python-0.7.0}/setup.py +9 -3
- kicad_python-0.5.0/build/lib/kipy/proto/board/board_commands_pb2.py +0 -99
- kicad_python-0.5.0/build/lib/kipy/proto/board/board_types_pb2.py +0 -150
- kicad_python-0.5.0/build/lib/kipy/proto/common/commands/editor_commands_pb2.py +0 -109
- kicad_python-0.5.0/build/lib/kipy/proto/common/types/base_types_pb2.py +0 -102
- kicad_python-0.5.0/build/lib/kipy/proto/common/types/project_settings_pb2.py +0 -31
- kicad_python-0.5.0/kipy/proto/board/board_commands_pb2.py +0 -99
- kicad_python-0.5.0/kipy/proto/board/board_types_pb2.py +0 -150
- kicad_python-0.5.0/kipy/proto/common/commands/editor_commands_pb2.py +0 -109
- kicad_python-0.5.0/kipy/proto/common/types/base_types_pb2.py +0 -102
- kicad_python-0.5.0/kipy/proto/common/types/project_settings_pb2.py +0 -31
- {kicad_python-0.5.0 → kicad_python-0.7.0}/LICENSE +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/client.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/errors.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/kicad.py +0 -0
- /kicad_python-0.5.0/kipy/py.typed → /kicad_python-0.7.0/build/lib/kipy/packaging/schemas/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/board/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/board/board_pb2.pyi +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/common/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/common/commands/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/common/commands/base_commands_pb2.pyi +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/common/commands/project_commands_pb2.pyi +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/common/envelope_pb2.pyi +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/common/types/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/schematic/schematic_commands_pb2.pyi +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/proto/schematic/schematic_types_pb2.pyi +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/util/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/util/board_layer.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/util/units.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build/lib/kipy/wrapper.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/build.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/client.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/errors.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/kicad.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/board/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/board/board_pb2.pyi +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/common/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/common/commands/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/common/commands/base_commands_pb2.pyi +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/common/commands/project_commands_pb2.pyi +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/common/envelope_pb2.pyi +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/common/types/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/schematic/schematic_commands_pb2.pyi +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/proto/schematic/schematic_types_pb2.pyi +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/util/__init__.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/util/board_layer.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/util/units.py +0 -0
- {kicad_python-0.5.0 → kicad_python-0.7.0}/kipy/wrapper.py +0 -0
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kicad-python
|
|
3
|
+
Version: 0.7.0
|
|
4
|
+
Summary: KiCad API Python Bindings
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Author: The KiCad Development Team
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
|
|
12
|
+
Classifier: Typing :: Typed
|
|
13
|
+
Requires-Dist: jsonschema (>=4.23.0,<5)
|
|
14
|
+
Requires-Dist: protobuf (>=5.29,<6)
|
|
15
|
+
Requires-Dist: pynng (>=0.9.0,<0.10.0)
|
|
16
|
+
Requires-Dist: typing_extensions (>=4.13.2) ; python_version < "3.13"
|
|
17
|
+
Project-URL: Documentation, https://docs.kicad.org/kicad-python-main/
|
|
18
|
+
Project-URL: Homepage, https://kicad.org/
|
|
19
|
+
Project-URL: Repository, https://gitlab.com/kicad/code/kicad-python
|
|
20
|
+
Project-URL: issues, https://gitlab.com/kicad/code/kicad-python/-/issues
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
1
23
|
# KiCad API Python Bindings
|
|
2
24
|
|
|
3
25
|
`kicad-python` is the official Python bindings for the [KiCad](https://kicad.org) IPC API. This
|
|
@@ -77,6 +99,27 @@ plugins, copy or symlink them into the appropriate plugins path in order for KiC
|
|
|
77
99
|
|
|
78
100
|
## Release History
|
|
79
101
|
|
|
102
|
+
### 0.7.0 (April 17, 2026)
|
|
103
|
+
|
|
104
|
+
- Add `Board.get_items_by_id` and groups support via `Board.get_groups` (requires KiCad 10) (Anthonypark, !15)
|
|
105
|
+
- Add support for barcodes and `Board.get_barcodes` (requires KiCad 10.0.1)
|
|
106
|
+
- Add support for reference images and `Board.get_reference_images` (requires KiCad 10.0.1)
|
|
107
|
+
- Add `Board.set_title_block_info` (requires KiCad 10.0.1)
|
|
108
|
+
- Add `Board.get_connected_items`, `Board.get_items_by_net`, and `Board.get_items_by_netclass` (requires KiCad 10.0.1)
|
|
109
|
+
- Fix several bounding box calculation bugs
|
|
110
|
+
- Support building with older versions of protoc
|
|
111
|
+
- Fix `KiCad.run_action` (leommxj)
|
|
112
|
+
|
|
113
|
+
### 0.6.0 (March 15, 2026)
|
|
114
|
+
|
|
115
|
+
- Fix missing conversion of rectangles into polygons when rotating by non-cardinal amounts (#86)
|
|
116
|
+
- Move to `pynng` 0.9.0 (John Hagen, !37)
|
|
117
|
+
- Add `locked` properties to `Track` and `ArcTrack` (Anton Lazarev, !34)
|
|
118
|
+
- Add `Board.get_layer_name` (KiCad 9.0.8) (#94)
|
|
119
|
+
- Ensure `PolygonWithHoles` outline and holes are closed shapes (#73)
|
|
120
|
+
- Fix `Project` taking over the document passed into it (#78)
|
|
121
|
+
- Fix missing setter on `Field.name` (#87)
|
|
122
|
+
|
|
80
123
|
### 0.5.0 (October 13, 2025)
|
|
81
124
|
|
|
82
125
|
- Add `Pad.pad_to_die_length` (KiCad 9.0.4)
|
|
@@ -144,3 +187,4 @@ plugins, copy or symlink them into the appropriate plugins path in order for KiC
|
|
|
144
187
|
First formal release of the new IPC-API version of this package. Contains support for most of the
|
|
145
188
|
KiCad API functionality that is currently exposed, which is focused around the PCB editor to enable
|
|
146
189
|
a transition path from existing SWIG-based plugins.
|
|
190
|
+
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: kicad-python
|
|
3
|
-
Version: 0.5.0
|
|
4
|
-
Summary: KiCad API Python Bindings
|
|
5
|
-
License-Expression: MIT
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Author: The KiCad Development Team
|
|
8
|
-
Requires-Python: >=3.9
|
|
9
|
-
Classifier: Development Status :: 4 - Beta
|
|
10
|
-
Classifier: Intended Audience :: Developers
|
|
11
|
-
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
|
|
12
|
-
Classifier: Typing :: Typed
|
|
13
|
-
Requires-Dist: protobuf (>=5.29,<6)
|
|
14
|
-
Requires-Dist: pynng (>=0.8.0,<0.9.0)
|
|
15
|
-
Requires-Dist: typing_extensions (>=4.13.2) ; python_version < "3.13"
|
|
16
|
-
Project-URL: Documentation, https://docs.kicad.org/kicad-python-main/
|
|
17
|
-
Project-URL: Homepage, https://kicad.org/
|
|
18
|
-
Project-URL: Repository, https://gitlab.com/kicad/code/kicad-python
|
|
19
|
-
Project-URL: issues, https://gitlab.com/kicad/code/kicad-python/-/issues
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
|
|
22
1
|
# KiCad API Python Bindings
|
|
23
2
|
|
|
24
3
|
`kicad-python` is the official Python bindings for the [KiCad](https://kicad.org) IPC API. This
|
|
@@ -98,6 +77,27 @@ plugins, copy or symlink them into the appropriate plugins path in order for KiC
|
|
|
98
77
|
|
|
99
78
|
## Release History
|
|
100
79
|
|
|
80
|
+
### 0.7.0 (April 17, 2026)
|
|
81
|
+
|
|
82
|
+
- Add `Board.get_items_by_id` and groups support via `Board.get_groups` (requires KiCad 10) (Anthonypark, !15)
|
|
83
|
+
- Add support for barcodes and `Board.get_barcodes` (requires KiCad 10.0.1)
|
|
84
|
+
- Add support for reference images and `Board.get_reference_images` (requires KiCad 10.0.1)
|
|
85
|
+
- Add `Board.set_title_block_info` (requires KiCad 10.0.1)
|
|
86
|
+
- Add `Board.get_connected_items`, `Board.get_items_by_net`, and `Board.get_items_by_netclass` (requires KiCad 10.0.1)
|
|
87
|
+
- Fix several bounding box calculation bugs
|
|
88
|
+
- Support building with older versions of protoc
|
|
89
|
+
- Fix `KiCad.run_action` (leommxj)
|
|
90
|
+
|
|
91
|
+
### 0.6.0 (March 15, 2026)
|
|
92
|
+
|
|
93
|
+
- Fix missing conversion of rectangles into polygons when rotating by non-cardinal amounts (#86)
|
|
94
|
+
- Move to `pynng` 0.9.0 (John Hagen, !37)
|
|
95
|
+
- Add `locked` properties to `Track` and `ArcTrack` (Anton Lazarev, !34)
|
|
96
|
+
- Add `Board.get_layer_name` (KiCad 9.0.8) (#94)
|
|
97
|
+
- Ensure `PolygonWithHoles` outline and holes are closed shapes (#73)
|
|
98
|
+
- Fix `Project` taking over the document passed into it (#78)
|
|
99
|
+
- Fix missing setter on `Field.name` (#87)
|
|
100
|
+
|
|
101
101
|
### 0.5.0 (October 13, 2025)
|
|
102
102
|
|
|
103
103
|
- Add `Pad.pad_to_die_length` (KiCad 9.0.4)
|
|
@@ -165,4 +165,3 @@ plugins, copy or symlink them into the appropriate plugins path in order for KiC
|
|
|
165
165
|
First formal release of the new IPC-API version of this package. Contains support for most of the
|
|
166
166
|
KiCad API functionality that is currently exposed, which is focused around the PCB editor to enable
|
|
167
167
|
a transition path from existing SWIG-based plugins.
|
|
168
|
-
|
|
@@ -24,8 +24,10 @@ from google.protobuf.empty_pb2 import Empty
|
|
|
24
24
|
|
|
25
25
|
from kipy.board_types import (
|
|
26
26
|
ArcTrack,
|
|
27
|
+
Barcode,
|
|
27
28
|
BoardEditorAppearanceSettings,
|
|
28
29
|
BoardItem,
|
|
30
|
+
ReferenceImage,
|
|
29
31
|
BoardText,
|
|
30
32
|
BoardTextBox,
|
|
31
33
|
Dimension,
|
|
@@ -36,6 +38,7 @@ from kipy.board_types import (
|
|
|
36
38
|
Track,
|
|
37
39
|
Via,
|
|
38
40
|
Zone,
|
|
41
|
+
Group,
|
|
39
42
|
to_concrete_board_shape,
|
|
40
43
|
to_concrete_dimension,
|
|
41
44
|
unwrap
|
|
@@ -57,7 +60,7 @@ from kipy.proto.common.commands.editor_commands_pb2 import (
|
|
|
57
60
|
EndCommit, EndCommitResponse,
|
|
58
61
|
CreateItems, CreateItemsResponse,
|
|
59
62
|
UpdateItems, UpdateItemsResponse,
|
|
60
|
-
GetItems, GetItemsResponse,
|
|
63
|
+
GetItems, GetItemsById, GetItemsResponse,
|
|
61
64
|
DeleteItems, DeleteItemsResponse,
|
|
62
65
|
HitTest, HitTestResponse, HitTestResult
|
|
63
66
|
)
|
|
@@ -350,8 +353,10 @@ class Board:
|
|
|
350
353
|
]
|
|
351
354
|
|
|
352
355
|
def _to_concrete_items(self, items: Sequence[Wrapper]) -> List[BoardItem]:
|
|
353
|
-
items_converted = []
|
|
356
|
+
items_converted: List[BoardItem] = []
|
|
354
357
|
for it in items:
|
|
358
|
+
assert isinstance(it, BoardItem)
|
|
359
|
+
|
|
355
360
|
if isinstance(it, BoardShape):
|
|
356
361
|
items_converted.append(to_concrete_board_shape(cast(BoardShape, it)))
|
|
357
362
|
elif isinstance(it, Dimension):
|
|
@@ -362,7 +367,7 @@ class Board:
|
|
|
362
367
|
|
|
363
368
|
def get_items(
|
|
364
369
|
self, types: Union[KiCadObjectType.ValueType, Sequence[KiCadObjectType.ValueType]]
|
|
365
|
-
) -> Sequence[
|
|
370
|
+
) -> Sequence[Item]:
|
|
366
371
|
"""Retrieves items from the board, optionally filtering to a single or set of types"""
|
|
367
372
|
command = GetItems()
|
|
368
373
|
command.header.document.CopyFrom(self._doc)
|
|
@@ -376,6 +381,105 @@ class Board:
|
|
|
376
381
|
[unwrap(item) for item in self._kicad.send(command, GetItemsResponse).items]
|
|
377
382
|
)
|
|
378
383
|
|
|
384
|
+
def get_items_by_id(
|
|
385
|
+
self, ids: Union[KIID, Sequence[KIID]]
|
|
386
|
+
) -> Sequence[Item]:
|
|
387
|
+
"""Retrieves items from the board by their KIID (internal unique identifier)
|
|
388
|
+
|
|
389
|
+
.. versionadded:: 0.7.0 (KiCad 10.0.0)
|
|
390
|
+
"""
|
|
391
|
+
command = GetItemsById()
|
|
392
|
+
command.header.document.CopyFrom(self._doc)
|
|
393
|
+
if isinstance(ids, KIID):
|
|
394
|
+
command.items.append(ids)
|
|
395
|
+
else:
|
|
396
|
+
command.items.extend(ids)
|
|
397
|
+
|
|
398
|
+
return self._to_concrete_items(
|
|
399
|
+
[unwrap(item) for item in self._kicad.send(command, GetItemsResponse).items]
|
|
400
|
+
)
|
|
401
|
+
|
|
402
|
+
def get_items_by_net(
|
|
403
|
+
self,
|
|
404
|
+
nets: Union[Net, Sequence[Net]],
|
|
405
|
+
types: Optional[
|
|
406
|
+
Union[KiCadObjectType.ValueType, Sequence[KiCadObjectType.ValueType]]
|
|
407
|
+
] = None,
|
|
408
|
+
) -> Sequence[Item]:
|
|
409
|
+
"""Retrieves items from the board, filtered by one or more nets
|
|
410
|
+
|
|
411
|
+
.. versionadded:: 0.7.0 (KiCad 10.0.1)"""
|
|
412
|
+
command = board_commands_pb2.GetItemsByNet()
|
|
413
|
+
command.header.document.CopyFrom(self._doc)
|
|
414
|
+
|
|
415
|
+
if isinstance(types, int):
|
|
416
|
+
command.types.append(types)
|
|
417
|
+
elif types is not None:
|
|
418
|
+
command.types.extend(types)
|
|
419
|
+
|
|
420
|
+
if isinstance(nets, Net):
|
|
421
|
+
command.nets.append(nets.proto)
|
|
422
|
+
else:
|
|
423
|
+
command.nets.extend([net.proto for net in nets])
|
|
424
|
+
|
|
425
|
+
return self._to_concrete_items(
|
|
426
|
+
[unwrap(item) for item in self._kicad.send(command, GetItemsResponse).items]
|
|
427
|
+
)
|
|
428
|
+
|
|
429
|
+
def get_items_by_netclass(
|
|
430
|
+
self,
|
|
431
|
+
net_classes: Union[str, Sequence[str]],
|
|
432
|
+
types: Optional[
|
|
433
|
+
Union[KiCadObjectType.ValueType, Sequence[KiCadObjectType.ValueType]]
|
|
434
|
+
] = None,
|
|
435
|
+
) -> Sequence[Item]:
|
|
436
|
+
"""Retrieves items from the board, filtered by one or more net class names
|
|
437
|
+
|
|
438
|
+
.. versionadded:: 0.7.0 (KiCad 10.0.1)"""
|
|
439
|
+
command = board_commands_pb2.GetItemsByNetClass()
|
|
440
|
+
command.header.document.CopyFrom(self._doc)
|
|
441
|
+
|
|
442
|
+
if isinstance(types, int):
|
|
443
|
+
command.types.append(types)
|
|
444
|
+
elif types is not None:
|
|
445
|
+
command.types.extend(types)
|
|
446
|
+
|
|
447
|
+
if isinstance(net_classes, str):
|
|
448
|
+
command.net_classes.append(net_classes)
|
|
449
|
+
else:
|
|
450
|
+
command.net_classes.extend(net_classes)
|
|
451
|
+
|
|
452
|
+
return self._to_concrete_items(
|
|
453
|
+
[unwrap(item) for item in self._kicad.send(command, GetItemsResponse).items]
|
|
454
|
+
)
|
|
455
|
+
|
|
456
|
+
def get_connected_items(
|
|
457
|
+
self,
|
|
458
|
+
items: Union[BoardItem, KIID, Sequence[Union[BoardItem, KIID]]],
|
|
459
|
+
types: Optional[
|
|
460
|
+
Union[KiCadObjectType.ValueType, Sequence[KiCadObjectType.ValueType]]
|
|
461
|
+
] = None,
|
|
462
|
+
) -> Sequence[Item]:
|
|
463
|
+
"""Retrieves items that are copper-connected to the given source item(s) or item IDs
|
|
464
|
+
|
|
465
|
+
.. versionadded:: 0.7.0 (KiCad 10.0.1)"""
|
|
466
|
+
command = board_commands_pb2.GetConnectedItems()
|
|
467
|
+
command.header.document.CopyFrom(self._doc)
|
|
468
|
+
|
|
469
|
+
if isinstance(types, int):
|
|
470
|
+
command.types.append(types)
|
|
471
|
+
elif types is not None:
|
|
472
|
+
command.types.extend(types)
|
|
473
|
+
|
|
474
|
+
source_items = [items] if isinstance(items, (BoardItem, KIID)) else items
|
|
475
|
+
|
|
476
|
+
for source in source_items:
|
|
477
|
+
command.items.append(source.id if isinstance(source, BoardItem) else source)
|
|
478
|
+
|
|
479
|
+
return self._to_concrete_items(
|
|
480
|
+
[unwrap(item) for item in self._kicad.send(command, GetItemsResponse).items]
|
|
481
|
+
)
|
|
482
|
+
|
|
379
483
|
def get_tracks(self) -> Sequence[Union[Track, ArcTrack]]:
|
|
380
484
|
"""Retrieves all tracks and arc tracks on the board"""
|
|
381
485
|
return [
|
|
@@ -432,10 +536,42 @@ class Board:
|
|
|
432
536
|
)
|
|
433
537
|
]
|
|
434
538
|
|
|
539
|
+
def get_barcodes(self) -> Sequence[Barcode]:
|
|
540
|
+
"""Retrieves all barcode objects on the board
|
|
541
|
+
|
|
542
|
+
.. versionadded:: 0.7.0"""
|
|
543
|
+
return [
|
|
544
|
+
cast(Barcode, item)
|
|
545
|
+
for item in self.get_items(types=[KiCadObjectType.KOT_PCB_BARCODE])
|
|
546
|
+
]
|
|
547
|
+
|
|
548
|
+
def get_reference_images(self) -> Sequence[ReferenceImage]:
|
|
549
|
+
"""Retrieves all reference image objects on the board
|
|
550
|
+
|
|
551
|
+
.. versionadded:: 0.7.0"""
|
|
552
|
+
return [
|
|
553
|
+
cast(ReferenceImage, item)
|
|
554
|
+
for item in self.get_items(types=[KiCadObjectType.KOT_PCB_REFERENCE_IMAGE])
|
|
555
|
+
]
|
|
556
|
+
|
|
435
557
|
def get_zones(self) -> Sequence[Zone]:
|
|
436
558
|
"""Retrieves all zones (including rule areas and graphic zones) on the board"""
|
|
437
559
|
return [cast(Zone, item) for item in self.get_items(types=[KiCadObjectType.KOT_PCB_ZONE])]
|
|
438
560
|
|
|
561
|
+
def get_groups(self) -> Sequence[Group]:
|
|
562
|
+
"""Retrieves all groups on the board
|
|
563
|
+
|
|
564
|
+
.. versionadded:: 0.7.0 (KiCad 10.0.0)"""
|
|
565
|
+
groups = [cast(Group, item) for item in self.get_items(types=[KiCadObjectType.KOT_PCB_GROUP])]
|
|
566
|
+
|
|
567
|
+
# Unwrap items in groups
|
|
568
|
+
if len(groups) > 0:
|
|
569
|
+
for group in groups:
|
|
570
|
+
items = self.get_items_by_id(group._item_ids)
|
|
571
|
+
group._unwrapped_items = items
|
|
572
|
+
|
|
573
|
+
return groups
|
|
574
|
+
|
|
439
575
|
def get_as_string(self) -> str:
|
|
440
576
|
"""Returns the board as a string in KiCad's board file format"""
|
|
441
577
|
command = editor_commands_pb2.SaveDocumentToString()
|
|
@@ -682,6 +818,15 @@ class Board:
|
|
|
682
818
|
cmd.document.CopyFrom(self._doc)
|
|
683
819
|
return TitleBlockInfo(self._kicad.send(cmd, base_types_pb2.TitleBlockInfo))
|
|
684
820
|
|
|
821
|
+
def set_title_block_info(self, title_block: TitleBlockInfo):
|
|
822
|
+
"""Sets the title block information for the board
|
|
823
|
+
|
|
824
|
+
.. versionadded:: 0.7.0 (with KiCad 10.0.1)"""
|
|
825
|
+
cmd = editor_commands_pb2.SetTitleBlockInfo()
|
|
826
|
+
cmd.document.CopyFrom(self._doc)
|
|
827
|
+
cmd.title_block.CopyFrom(title_block.proto)
|
|
828
|
+
self._kicad.send(cmd, Empty)
|
|
829
|
+
|
|
685
830
|
def get_origin(self, origin_type: board_commands_pb2.BoardOriginType.ValueType) -> Vector2:
|
|
686
831
|
"""Retrieves the specified (grid or drill/place) board origin
|
|
687
832
|
|
|
@@ -702,6 +847,16 @@ class Board:
|
|
|
702
847
|
cmd.origin.CopyFrom(origin.proto)
|
|
703
848
|
self._kicad.send(cmd, Empty)
|
|
704
849
|
|
|
850
|
+
def get_layer_name(self, layer: board_types_pb2.BoardLayer.ValueType) -> str:
|
|
851
|
+
"""Retrieves the user-visible name of a given layer, which may be a default value like "F.Cu"
|
|
852
|
+
or may have been customized by the user. This method does not apply to dielectric layers.
|
|
853
|
+
|
|
854
|
+
.. versionadded:: 0.6.0 (KiCad 9.0.8)"""
|
|
855
|
+
cmd = board_commands_pb2.GetBoardLayerName()
|
|
856
|
+
cmd.board.CopyFrom(self._doc)
|
|
857
|
+
cmd.layer = layer
|
|
858
|
+
return self._kicad.send(cmd, board_commands_pb2.BoardLayerNameResponse).name
|
|
859
|
+
|
|
705
860
|
@overload
|
|
706
861
|
def expand_text_variables(self, text: str) -> str:
|
|
707
862
|
...
|
|
@@ -823,7 +978,7 @@ class Board:
|
|
|
823
978
|
cmd = board_commands_pb2.CheckPadstackPresenceOnLayers()
|
|
824
979
|
cmd.board.CopyFrom(self._doc)
|
|
825
980
|
|
|
826
|
-
items_map = {}
|
|
981
|
+
items_map: Dict[str, BoardItem] = {}
|
|
827
982
|
|
|
828
983
|
if isinstance(items, BoardItem):
|
|
829
984
|
cmd.items.append(items.id)
|
|
@@ -839,7 +994,7 @@ class Board:
|
|
|
839
994
|
|
|
840
995
|
response = self._kicad.send(cmd, board_commands_pb2.PadstackPresenceResponse)
|
|
841
996
|
|
|
842
|
-
result = {}
|
|
997
|
+
result: Dict[BoardItem, Dict[board_types_pb2.BoardLayer.ValueType, bool]] = {}
|
|
843
998
|
for entry in response.entries:
|
|
844
999
|
if entry.item.value not in items_map:
|
|
845
1000
|
continue
|