kicad-python 0.3.0__tar.gz → 0.4.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 (98) hide show
  1. {kicad_python-0.3.0 → kicad_python-0.4.0}/PKG-INFO +24 -3
  2. {kicad_python-0.3.0 → kicad_python-0.4.0}/README.md +21 -1
  3. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/board.py +66 -0
  4. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/board_types.py +285 -53
  5. {kicad_python-0.3.0 → kicad_python-0.4.0/build/lib}/kipy/common_types.py +53 -3
  6. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/geometry.py +110 -9
  7. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/kicad.py +5 -1
  8. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/kicad_api_version.py +1 -1
  9. {kicad_python-0.3.0 → kicad_python-0.4.0/build/lib}/kipy/proto/board/board_commands_pb2.py +39 -31
  10. {kicad_python-0.3.0 → kicad_python-0.4.0/build/lib}/kipy/proto/board/board_commands_pb2.pyi +98 -0
  11. {kicad_python-0.3.0 → kicad_python-0.4.0/build/lib}/kipy/proto/board/board_types_pb2.py +54 -54
  12. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/board/board_types_pb2.pyi +8 -3
  13. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/wrapper.py +10 -1
  14. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/board.py +66 -0
  15. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/board_types.py +285 -53
  16. {kicad_python-0.3.0/build/lib → kicad_python-0.4.0}/kipy/common_types.py +53 -3
  17. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/geometry.py +110 -9
  18. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/kicad.py +5 -1
  19. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/kicad_api_version.py +1 -1
  20. {kicad_python-0.3.0/build/lib → kicad_python-0.4.0}/kipy/proto/board/board_commands_pb2.py +39 -31
  21. {kicad_python-0.3.0/build/lib → kicad_python-0.4.0}/kipy/proto/board/board_commands_pb2.pyi +98 -0
  22. {kicad_python-0.3.0/build/lib → kicad_python-0.4.0}/kipy/proto/board/board_types_pb2.py +54 -54
  23. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/board/board_types_pb2.pyi +8 -3
  24. kicad_python-0.4.0/kipy/py.typed +0 -0
  25. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/wrapper.py +10 -1
  26. {kicad_python-0.3.0 → kicad_python-0.4.0}/pyproject.toml +13 -4
  27. kicad_python-0.4.0/setup.py +42 -0
  28. kicad_python-0.3.0/setup.py +0 -38
  29. {kicad_python-0.3.0 → kicad_python-0.4.0}/LICENSE +0 -0
  30. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/__init__.py +0 -0
  31. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/client.py +0 -0
  32. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/errors.py +0 -0
  33. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/project.py +0 -0
  34. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/project_types.py +0 -0
  35. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/__init__.py +0 -0
  36. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/board/__init__.py +0 -0
  37. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/board/board_pb2.py +0 -0
  38. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/board/board_pb2.pyi +0 -0
  39. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/__init__.py +0 -0
  40. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/commands/__init__.py +0 -0
  41. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/commands/base_commands_pb2.py +0 -0
  42. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/commands/base_commands_pb2.pyi +0 -0
  43. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/commands/editor_commands_pb2.py +0 -0
  44. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/commands/editor_commands_pb2.pyi +0 -0
  45. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/commands/project_commands_pb2.py +0 -0
  46. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/commands/project_commands_pb2.pyi +0 -0
  47. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/envelope_pb2.py +0 -0
  48. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/envelope_pb2.pyi +0 -0
  49. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/types/__init__.py +0 -0
  50. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/types/base_types_pb2.py +0 -0
  51. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/types/base_types_pb2.pyi +0 -0
  52. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/types/enums_pb2.py +0 -0
  53. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/types/enums_pb2.pyi +0 -0
  54. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/types/project_settings_pb2.py +0 -0
  55. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/common/types/project_settings_pb2.pyi +0 -0
  56. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/schematic/schematic_commands_pb2.py +0 -0
  57. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/schematic/schematic_commands_pb2.pyi +0 -0
  58. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/schematic/schematic_types_pb2.py +0 -0
  59. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/proto/schematic/schematic_types_pb2.pyi +0 -0
  60. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/util/__init__.py +0 -0
  61. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/util/board_layer.py +0 -0
  62. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/util/proto.py +0 -0
  63. {kicad_python-0.3.0 → kicad_python-0.4.0}/build/lib/kipy/util/units.py +0 -0
  64. {kicad_python-0.3.0 → kicad_python-0.4.0}/build.py +0 -0
  65. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/__init__.py +0 -0
  66. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/client.py +0 -0
  67. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/errors.py +0 -0
  68. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/project.py +0 -0
  69. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/project_types.py +0 -0
  70. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/__init__.py +0 -0
  71. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/board/__init__.py +0 -0
  72. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/board/board_pb2.py +0 -0
  73. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/board/board_pb2.pyi +0 -0
  74. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/__init__.py +0 -0
  75. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/commands/__init__.py +0 -0
  76. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/commands/base_commands_pb2.py +0 -0
  77. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/commands/base_commands_pb2.pyi +0 -0
  78. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/commands/editor_commands_pb2.py +0 -0
  79. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/commands/editor_commands_pb2.pyi +0 -0
  80. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/commands/project_commands_pb2.py +0 -0
  81. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/commands/project_commands_pb2.pyi +0 -0
  82. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/envelope_pb2.py +0 -0
  83. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/envelope_pb2.pyi +0 -0
  84. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/types/__init__.py +0 -0
  85. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/types/base_types_pb2.py +0 -0
  86. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/types/base_types_pb2.pyi +0 -0
  87. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/types/enums_pb2.py +0 -0
  88. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/types/enums_pb2.pyi +0 -0
  89. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/types/project_settings_pb2.py +0 -0
  90. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/common/types/project_settings_pb2.pyi +0 -0
  91. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/schematic/schematic_commands_pb2.py +0 -0
  92. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/schematic/schematic_commands_pb2.pyi +0 -0
  93. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/schematic/schematic_types_pb2.py +0 -0
  94. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/proto/schematic/schematic_types_pb2.pyi +0 -0
  95. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/util/__init__.py +0 -0
  96. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/util/board_layer.py +0 -0
  97. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/util/proto.py +0 -0
  98. {kicad_python-0.3.0 → kicad_python-0.4.0}/kipy/util/units.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: kicad-python
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: KiCad API Python Bindings
5
5
  License: MIT
6
6
  Author: The KiCad Development Team
@@ -15,9 +15,10 @@ Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Programming Language :: Python :: 3.12
16
16
  Classifier: Programming Language :: Python :: 3.13
17
17
  Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
18
- Requires-Dist: deprecated (>=1.2,<2.0)
18
+ Classifier: Typing :: Typed
19
19
  Requires-Dist: protobuf (>=5.29,<6.0)
20
20
  Requires-Dist: pynng (>=0.8.0,<0.9.0)
21
+ Requires-Dist: typing-extensions (>=4.13.2) ; python_version < "3.13"
21
22
  Project-URL: Homepage, https://kicad.org/
22
23
  Project-URL: Repository, https://gitlab.com/kicad/code/kicad-python
23
24
  Description-Content-Type: text/markdown
@@ -31,7 +32,10 @@ The KiCad IPC API can be considered in "public beta" state with the release of K
31
32
  planned for on or around February 1, 2025). The existing SWIG-based Python bindings for KiCad's
32
33
  PCB editor still exist in KiCad 9, but are in maintenance mode and will not be expanded.
33
34
 
34
- For more information about the IPC API, please see the [KiCad developer documentation](https://dev-docs.kicad.org/en/apis-and-binding/ipc-api/index.html). Specific documentation for developing add-ons is [also available](https://dev-docs.kicad.org/en/apis-and-binding/ipc-api/for-addon-developers/index.html).
35
+ For more information about the IPC API, please see the
36
+ [KiCad developer documentation](https://dev-docs.kicad.org/en/apis-and-binding/ipc-api/index.html).
37
+ Specific documentation for developing add-ons is
38
+ [also available](https://dev-docs.kicad.org/en/apis-and-binding/ipc-api/for-addon-developers/index.html).
35
39
 
36
40
  > Note: Version 0.0.2 and prior of this package are an obsolete earlier effort and are unrelated to
37
41
  > this codebase.
@@ -98,6 +102,23 @@ plugins, copy or symlink them into the appropriate plugins path in order for KiC
98
102
 
99
103
  ## Release History
100
104
 
105
+ ### 0.4.0 (July 8, 2025)
106
+
107
+ - Fix ability to move and rotate footprints
108
+ - Fix ArcTrack length calculation (Quentin Freimanis, !13)
109
+ - Make it possible to add new `BoardPolygon`s in a more ergonomic way
110
+ - Add `FootprintInstance.sheet_path` property (#37)
111
+ - Add `board.check_padstack_presence_on_layers`, replacing FlashLayer in SWIG
112
+ - Allow setting `Net.name` so that new nets can be created
113
+ - Deprecate `Net.code` (net codes are an internal KiCad detail and API clients should ignore them)
114
+ - Add `py.typed` type hinting indicator file (John Hagen, !16)
115
+ - Fix `Vector2.from_xy_mm` type annotations (John Hagen, !17)
116
+ - Add `Arc.angle` and `ArcTrack.angle`; some arc angle utilities (Quentin Freimanis, !14)
117
+ - Add `remove_items_by_id` (Anthonypark, !20)
118
+ - Allow assigning nets to `Zone` (#62)
119
+ - Allow changing `Pad.pad_type` (#63)
120
+ - Allow changing `Field.layer` (#64)
121
+
101
122
  ### 0.3.0 (March 29, 2025)
102
123
 
103
124
  - Add support for footprint mounting style attribute (#19) (Thanh Duong, !10)
@@ -7,7 +7,10 @@ The KiCad IPC API can be considered in "public beta" state with the release of K
7
7
  planned for on or around February 1, 2025). The existing SWIG-based Python bindings for KiCad's
8
8
  PCB editor still exist in KiCad 9, but are in maintenance mode and will not be expanded.
9
9
 
10
- For more information about the IPC API, please see the [KiCad developer documentation](https://dev-docs.kicad.org/en/apis-and-binding/ipc-api/index.html). Specific documentation for developing add-ons is [also available](https://dev-docs.kicad.org/en/apis-and-binding/ipc-api/for-addon-developers/index.html).
10
+ For more information about the IPC API, please see the
11
+ [KiCad developer documentation](https://dev-docs.kicad.org/en/apis-and-binding/ipc-api/index.html).
12
+ Specific documentation for developing add-ons is
13
+ [also available](https://dev-docs.kicad.org/en/apis-and-binding/ipc-api/for-addon-developers/index.html).
11
14
 
12
15
  > Note: Version 0.0.2 and prior of this package are an obsolete earlier effort and are unrelated to
13
16
  > this codebase.
@@ -74,6 +77,23 @@ plugins, copy or symlink them into the appropriate plugins path in order for KiC
74
77
 
75
78
  ## Release History
76
79
 
80
+ ### 0.4.0 (July 8, 2025)
81
+
82
+ - Fix ability to move and rotate footprints
83
+ - Fix ArcTrack length calculation (Quentin Freimanis, !13)
84
+ - Make it possible to add new `BoardPolygon`s in a more ergonomic way
85
+ - Add `FootprintInstance.sheet_path` property (#37)
86
+ - Add `board.check_padstack_presence_on_layers`, replacing FlashLayer in SWIG
87
+ - Allow setting `Net.name` so that new nets can be created
88
+ - Deprecate `Net.code` (net codes are an internal KiCad detail and API clients should ignore them)
89
+ - Add `py.typed` type hinting indicator file (John Hagen, !16)
90
+ - Fix `Vector2.from_xy_mm` type annotations (John Hagen, !17)
91
+ - Add `Arc.angle` and `ArcTrack.angle`; some arc angle utilities (Quentin Freimanis, !14)
92
+ - Add `remove_items_by_id` (Anthonypark, !20)
93
+ - Allow assigning nets to `Zone` (#62)
94
+ - Allow changing `Pad.pad_type` (#63)
95
+ - Allow changing `Field.layer` (#64)
96
+
77
97
  ### 0.3.0 (March 29, 2025)
78
98
 
79
99
  - Add support for footprint mounting style attribute (#19) (Thanh Duong, !10)
@@ -489,6 +489,23 @@ class Board:
489
489
 
490
490
  self._kicad.send(command, DeleteItemsResponse)
491
491
 
492
+ def remove_items_by_id(self, items: Union[KIID, Sequence[KIID]]):
493
+ """Deletes one or more items from the board using their unique IDs
494
+
495
+ .. versionadded:: 0.4.0"""
496
+ command = DeleteItems()
497
+ command.header.document.CopyFrom(self._doc)
498
+
499
+ if isinstance(items, KIID):
500
+ command.item_ids.append(items)
501
+ else:
502
+ command.item_ids.extend(items)
503
+
504
+ if len(command.item_ids) == 0:
505
+ return
506
+
507
+ self._kicad.send(command, DeleteItemsResponse)
508
+
492
509
  def get_nets(
493
510
  self, netclass_filter: Optional[Union[str, Sequence[str]]] = None
494
511
  ) -> Sequence[Net]:
@@ -742,6 +759,55 @@ class Board:
742
759
  if p is not None
743
760
  ]
744
761
 
762
+ def check_padstack_presence_on_layers(
763
+ self,
764
+ items: Union[BoardItem, Iterable[BoardItem]],
765
+ layers: Union[board_types_pb2.BoardLayer.ValueType, Iterable[board_types_pb2.BoardLayer.ValueType]]
766
+ ) -> Dict[BoardItem, Dict[board_types_pb2.BoardLayer.ValueType, bool]]:
767
+ """Checks if the given items with padstacks (pads or vias) have content on the given layers.
768
+
769
+ :param items: The items to check (one or more pads or vias).
770
+ :param layers: The layer or layers to check for padstack presence.
771
+ :return: A dictionary mapping each item to a dictionary of layers and their presence on
772
+ the given layer.
773
+
774
+ .. versionadded:: 0.4.0 with KiCad 9.0.3
775
+ """
776
+ cmd = board_commands_pb2.CheckPadstackPresenceOnLayers()
777
+ cmd.board.CopyFrom(self._doc)
778
+
779
+ items_map = {}
780
+
781
+ if isinstance(items, BoardItem):
782
+ cmd.items.append(items.id)
783
+ items_map[items.id.value] = items
784
+ else:
785
+ cmd.items.extend([item.id for item in items])
786
+ items_map.update({item.id.value: item for item in items})
787
+
788
+ if isinstance(layers, int):
789
+ cmd.layers.append(layers)
790
+ else:
791
+ cmd.layers.extend(layers)
792
+
793
+ response = self._kicad.send(cmd, board_commands_pb2.PadstackPresenceResponse)
794
+
795
+ result = {}
796
+ for entry in response.entries:
797
+ if entry.item.value not in items_map:
798
+ continue
799
+
800
+ item = items_map[entry.item.value]
801
+ layer = entry.layer
802
+ presence = entry.presence is board_commands_pb2.PadstackPresence.PSP_PRESENT
803
+
804
+ if item not in result:
805
+ result[item] = {}
806
+
807
+ result[item][layer] = presence
808
+
809
+ return result
810
+
745
811
  def interactive_move(self, items: Union[KIID, Iterable[KIID]]):
746
812
  """Initiates an interactive move operation on one or more items on the board. The user
747
813
  will be able to move the items interactively in the KiCad editor. This is a blocking