kicad-sch-api 0.4.1__py3-none-any.whl → 0.5.1__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 (66) hide show
  1. kicad_sch_api/__init__.py +67 -2
  2. kicad_sch_api/cli/kicad_to_python.py +169 -0
  3. kicad_sch_api/collections/__init__.py +23 -8
  4. kicad_sch_api/collections/base.py +369 -59
  5. kicad_sch_api/collections/components.py +1376 -187
  6. kicad_sch_api/collections/junctions.py +129 -289
  7. kicad_sch_api/collections/labels.py +391 -287
  8. kicad_sch_api/collections/wires.py +202 -316
  9. kicad_sch_api/core/__init__.py +37 -2
  10. kicad_sch_api/core/component_bounds.py +34 -12
  11. kicad_sch_api/core/components.py +146 -7
  12. kicad_sch_api/core/config.py +25 -12
  13. kicad_sch_api/core/connectivity.py +692 -0
  14. kicad_sch_api/core/exceptions.py +175 -0
  15. kicad_sch_api/core/factories/element_factory.py +3 -1
  16. kicad_sch_api/core/formatter.py +24 -7
  17. kicad_sch_api/core/geometry.py +94 -5
  18. kicad_sch_api/core/managers/__init__.py +4 -0
  19. kicad_sch_api/core/managers/base.py +76 -0
  20. kicad_sch_api/core/managers/file_io.py +3 -1
  21. kicad_sch_api/core/managers/format_sync.py +3 -2
  22. kicad_sch_api/core/managers/graphics.py +3 -2
  23. kicad_sch_api/core/managers/hierarchy.py +661 -0
  24. kicad_sch_api/core/managers/metadata.py +4 -2
  25. kicad_sch_api/core/managers/sheet.py +52 -14
  26. kicad_sch_api/core/managers/text_elements.py +3 -2
  27. kicad_sch_api/core/managers/validation.py +3 -2
  28. kicad_sch_api/core/managers/wire.py +112 -54
  29. kicad_sch_api/core/parsing_utils.py +63 -0
  30. kicad_sch_api/core/pin_utils.py +103 -9
  31. kicad_sch_api/core/schematic.py +343 -29
  32. kicad_sch_api/core/types.py +79 -7
  33. kicad_sch_api/exporters/__init__.py +10 -0
  34. kicad_sch_api/exporters/python_generator.py +610 -0
  35. kicad_sch_api/exporters/templates/default.py.jinja2 +65 -0
  36. kicad_sch_api/geometry/__init__.py +15 -3
  37. kicad_sch_api/geometry/routing.py +211 -0
  38. kicad_sch_api/parsers/elements/label_parser.py +30 -8
  39. kicad_sch_api/parsers/elements/symbol_parser.py +255 -83
  40. kicad_sch_api/utils/logging.py +555 -0
  41. kicad_sch_api/utils/logging_decorators.py +587 -0
  42. kicad_sch_api/utils/validation.py +16 -22
  43. kicad_sch_api/wrappers/__init__.py +14 -0
  44. kicad_sch_api/wrappers/base.py +89 -0
  45. kicad_sch_api/wrappers/wire.py +198 -0
  46. kicad_sch_api-0.5.1.dist-info/METADATA +540 -0
  47. kicad_sch_api-0.5.1.dist-info/RECORD +114 -0
  48. kicad_sch_api-0.5.1.dist-info/entry_points.txt +4 -0
  49. {kicad_sch_api-0.4.1.dist-info → kicad_sch_api-0.5.1.dist-info}/top_level.txt +1 -0
  50. mcp_server/__init__.py +34 -0
  51. mcp_server/example_logging_integration.py +506 -0
  52. mcp_server/models.py +252 -0
  53. mcp_server/server.py +357 -0
  54. mcp_server/tools/__init__.py +32 -0
  55. mcp_server/tools/component_tools.py +516 -0
  56. mcp_server/tools/connectivity_tools.py +532 -0
  57. mcp_server/tools/consolidated_tools.py +1216 -0
  58. mcp_server/tools/pin_discovery.py +333 -0
  59. mcp_server/utils/__init__.py +38 -0
  60. mcp_server/utils/logging.py +127 -0
  61. mcp_server/utils.py +36 -0
  62. kicad_sch_api-0.4.1.dist-info/METADATA +0 -491
  63. kicad_sch_api-0.4.1.dist-info/RECORD +0 -87
  64. kicad_sch_api-0.4.1.dist-info/entry_points.txt +0 -2
  65. {kicad_sch_api-0.4.1.dist-info → kicad_sch_api-0.5.1.dist-info}/WHEEL +0 -0
  66. {kicad_sch_api-0.4.1.dist-info → kicad_sch_api-0.5.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,491 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: kicad-sch-api
3
- Version: 0.4.1
4
- Summary: Professional KiCAD schematic manipulation library with exact format preservation
5
- Author-email: Circuit-Synth <shane@circuit-synth.com>
6
- Maintainer-email: Circuit-Synth <shane@circuit-synth.com>
7
- License-Expression: MIT
8
- Project-URL: Homepage, https://github.com/circuit-synth/kicad-sch-api
9
- Project-URL: Documentation, https://kicad-sch-api.readthedocs.io/
10
- Project-URL: Repository, https://github.com/circuit-synth/kicad-sch-api.git
11
- Project-URL: Bug Reports, https://github.com/circuit-synth/kicad-sch-api/issues
12
- Project-URL: Changelog, https://github.com/circuit-synth/kicad-sch-api/blob/main/CHANGELOG.md
13
- Keywords: kicad,schematic,eda,electronics,circuit-design,ai,automation,pcb
14
- Classifier: Development Status :: 4 - Beta
15
- Classifier: Intended Audience :: Developers
16
- Classifier: Intended Audience :: Science/Research
17
- Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
18
- Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.8
20
- Classifier: Programming Language :: Python :: 3.9
21
- Classifier: Programming Language :: Python :: 3.10
22
- Classifier: Programming Language :: Python :: 3.11
23
- Classifier: Programming Language :: Python :: 3.12
24
- Classifier: Operating System :: OS Independent
25
- Requires-Python: >=3.10
26
- Description-Content-Type: text/markdown
27
- License-File: LICENSE
28
- Requires-Dist: sexpdata>=0.0.3
29
- Requires-Dist: typing-extensions>=4.0.0; python_version < "3.11"
30
- Provides-Extra: dev
31
- Requires-Dist: pytest>=7.0.0; extra == "dev"
32
- Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
33
- Requires-Dist: pytest-xdist>=3.0.0; extra == "dev"
34
- Requires-Dist: black>=22.0.0; extra == "dev"
35
- Requires-Dist: isort>=5.0.0; extra == "dev"
36
- Requires-Dist: flake8>=4.0.0; extra == "dev"
37
- Requires-Dist: mypy>=1.0.0; extra == "dev"
38
- Requires-Dist: pre-commit>=3.0.0; extra == "dev"
39
- Provides-Extra: docs
40
- Requires-Dist: sphinx>=5.0.0; extra == "docs"
41
- Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "docs"
42
- Requires-Dist: myst-parser>=0.18.0; extra == "docs"
43
- Dynamic: license-file
44
-
45
- # KiCAD Schematic API
46
-
47
- [![Documentation Status](https://readthedocs.org/projects/kicad-sch-api/badge/?version=latest)](https://kicad-sch-api.readthedocs.io/en/latest/?badge=latest)
48
- [![PyPI version](https://badge.fury.io/py/kicad-sch-api.svg)](https://badge.fury.io/py/kicad-sch-api)
49
- [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
50
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
51
-
52
- **Professional Python library for KiCAD schematic file manipulation with exact format preservation**
53
-
54
- ## Overview
55
-
56
- Create and manipulate KiCAD schematic files programmatically with guaranteed exact format preservation. This library serves as the foundation for EDA automation tools and AI agents that need reliable, professional-grade schematic manipulation capabilities.
57
-
58
- ## 🎯 Core Features
59
-
60
- - **📋 Exact Format Preservation**: Byte-perfect KiCAD output that matches native formatting
61
- - **🏗️ Professional Component Management**: Object-oriented collections with search and validation
62
- - **⚡ High Performance**: Optimized for large schematics with intelligent caching
63
- - **🔍 Real KiCAD Library Integration**: Access to actual KiCAD symbol libraries and validation
64
- - **📐 Component Bounding Boxes**: Precise component boundary calculation and visualization
65
- - **🎨 Colored Rectangle Graphics**: KiCAD-compatible rectangles with all stroke types and colors
66
- - **🛣️ Manhattan Routing**: Intelligent wire routing with obstacle avoidance
67
- - **🤖 AI Agent Ready**: MCP server for seamless integration with AI development tools
68
- - **📚 Hierarchical Design**: Complete support for multi-sheet schematic projects
69
-
70
- ## 🚀 Quick Start
71
-
72
- ### Installation
73
-
74
- ```bash
75
- # Install from PyPI
76
- pip install kicad-sch-api
77
-
78
- # Or install from source
79
- git clone https://github.com/circuit-synth/kicad-sch-api.git
80
- cd kicad-sch-api/python
81
- uv pip install -e .
82
- ```
83
-
84
- ### Basic Usage
85
-
86
- ```python
87
- import kicad_sch_api as ksa
88
-
89
- # Create a new schematic
90
- sch = ksa.create_schematic("My Circuit")
91
-
92
- # Add components with proper validation
93
- resistor = sch.components.add(
94
- lib_id="Device:R",
95
- reference="R1",
96
- value="10k",
97
- position=(100.0, 100.0),
98
- footprint="Resistor_SMD:R_0603_1608Metric",
99
- datasheet="~",
100
- description="Resistor"
101
- )
102
-
103
- capacitor = sch.components.add(
104
- lib_id="Device:C",
105
- reference="C1",
106
- value="100nF",
107
- position=(150.0, 100.0),
108
- footprint="Capacitor_SMD:C_0603_1608Metric"
109
- )
110
-
111
- # Add wires for connectivity
112
- sch.wires.add(start=(100, 110), end=(150, 110))
113
-
114
- # Pin-to-pin wiring (NEW in v0.3.1)
115
- wire_uuid = sch.add_wire_between_pins("R1", "2", "C1", "1") # Connect R1 pin 2 to C1 pin 1
116
- external_wire = sch.add_wire_to_pin((50, 100), "R1", "1") # Connect external point to R1 pin 1
117
-
118
- # Add labels for nets
119
- sch.add_label("VCC", position=(125, 110))
120
-
121
- # Save with exact format preservation
122
- sch.save("my_circuit.kicad_sch")
123
- ```
124
-
125
- ### Hierarchical Design
126
-
127
- ```python
128
- # Create main schematic with hierarchical sheet
129
- main_sch = ksa.create_schematic("Main Board")
130
-
131
- # Add hierarchical sheet
132
- power_sheet = main_sch.add_hierarchical_sheet(
133
- name="Power Supply",
134
- filename="power.kicad_sch",
135
- position=(100, 100),
136
- size=(80, 60)
137
- )
138
-
139
- # Add sheet pins for connectivity
140
- power_sheet.add_pin("VIN", pin_type="input", position=(0, 10))
141
- power_sheet.add_pin("VOUT", pin_type="output", position=(80, 10))
142
-
143
- # Create the sub-schematic
144
- power_sch = ksa.create_schematic("Power Supply")
145
- power_sch.add_hierarchical_label("VIN", label_type="input", position=(50, 25))
146
- power_sch.add_hierarchical_label("VOUT", label_type="output", position=(150, 25))
147
-
148
- # Save both schematics
149
- main_sch.save("main.kicad_sch")
150
- power_sch.save("power.kicad_sch")
151
- ```
152
-
153
- ## 🔧 Advanced Features
154
-
155
- ### Component Bounding Boxes and Colored Graphics (NEW in v0.3.1)
156
-
157
- ```python
158
- from kicad_sch_api.core.component_bounds import get_component_bounding_box
159
-
160
- # Add components
161
- resistor = sch.components.add("Device:R", "R1", "10k", (100, 100))
162
- opamp = sch.components.add("Amplifier_Operational:LM358", "U1", "LM358", (150, 100))
163
-
164
- # Get component bounding boxes
165
- bbox_body = get_component_bounding_box(resistor, include_properties=False)
166
- bbox_full = get_component_bounding_box(resistor, include_properties=True)
167
-
168
- # Draw colored bounding box rectangles
169
- sch.draw_bounding_box(bbox_body, stroke_width=0.5, stroke_color="blue", stroke_type="solid")
170
- sch.draw_bounding_box(bbox_full, stroke_width=0.3, stroke_color="red", stroke_type="dash")
171
-
172
- # Draw bounding boxes for all components at once
173
- bbox_uuids = sch.draw_component_bounding_boxes(
174
- include_properties=True,
175
- stroke_width=0.4,
176
- stroke_color="green",
177
- stroke_type="dot"
178
- )
179
- ```
180
-
181
- ### Manhattan Routing with Obstacle Avoidance (NEW in v0.3.1)
182
-
183
- ```python
184
- from kicad_sch_api.core.manhattan_routing import ManhattanRouter
185
- from kicad_sch_api.core.types import Point
186
-
187
- # Create router
188
- router = ManhattanRouter()
189
-
190
- # Add components that act as obstacles
191
- r1 = sch.components.add("Device:R", "R1", "1k", (50, 50))
192
- r2 = sch.components.add("Device:R", "R2", "2k", (150, 150))
193
- obstacle = sch.components.add("Device:C", "C1", "100nF", (100, 100))
194
-
195
- # Get obstacle bounding boxes
196
- obstacle_bbox = get_component_bounding_box(obstacle, include_properties=False)
197
-
198
- # Route around obstacles
199
- start_point = Point(r1.position.x, r1.position.y)
200
- end_point = Point(r2.position.x, r2.position.y)
201
- path = router.route_between_points(start_point, end_point, [obstacle_bbox], clearance=2.0)
202
-
203
- # Add wires along the path
204
- for i in range(len(path) - 1):
205
- sch.wires.add(path[i], path[i + 1])
206
- ```
207
-
208
- ### Pin-to-Pin Wiring
209
-
210
- ```python
211
- # Connect component pins directly - automatically calculates pin positions
212
- wire_uuid = sch.add_wire_between_pins("R1", "2", "R2", "1") # R1 pin 2 to R2 pin 1
213
-
214
- # Connect arbitrary point to component pin
215
- external_wire = sch.add_wire_to_pin((75, 125), "R1", "1") # External point to R1 pin 1
216
- tuple_wire = sch.add_wire_to_pin(Point(100, 150), "C1", "2") # Using Point object
217
-
218
- # Get component pin positions for advanced operations
219
- pin_position = sch.get_component_pin_position("R1", "1")
220
- if pin_position:
221
- print(f"R1 pin 1 is at ({pin_position.x:.2f}, {pin_position.y:.2f})")
222
-
223
- # Error handling - returns None for invalid components/pins
224
- invalid_wire = sch.add_wire_between_pins("R999", "1", "R1", "1") # Returns None
225
- ```
226
-
227
- ### Component Bounding Box Visualization (NEW in v0.3.1)
228
-
229
- ```python
230
- from kicad_sch_api.core.component_bounds import get_component_bounding_box
231
-
232
- # Get component bounding box (body only)
233
- resistor = sch.components.get("R1")
234
- bbox = get_component_bounding_box(resistor, include_properties=False)
235
- print(f"R1 body size: {bbox.width:.2f}×{bbox.height:.2f}mm")
236
-
237
- # Get bounding box including properties (reference, value, etc.)
238
- bbox_with_props = get_component_bounding_box(resistor, include_properties=True)
239
- print(f"R1 with labels: {bbox_with_props.width:.2f}×{bbox_with_props.height:.2f}mm")
240
-
241
- # Draw bounding box as rectangle graphics (for visualization/debugging)
242
- rect_uuid = sch.draw_bounding_box(bbox)
243
- print(f"Drew bounding box rectangle: {rect_uuid}")
244
-
245
- # Draw bounding boxes for all components
246
- bbox_uuids = sch.draw_component_bounding_boxes(
247
- include_properties=False # True to include reference/value labels
248
- )
249
- print(f"Drew {len(bbox_uuids)} component bounding boxes")
250
-
251
- # Expand bounding box for clearance analysis
252
- expanded_bbox = bbox.expand(2.54) # Expand by 2.54mm (0.1 inch)
253
- clearance_rect = sch.draw_bounding_box(expanded_bbox)
254
- ```
255
-
256
- ### Manhattan Routing with Obstacle Avoidance (NEW in v0.3.1)
257
-
258
- ```python
259
- # Automatic Manhattan routing between component pins
260
- wire_segments = sch.auto_route_pins(
261
- "R1", "2", # From component R1, pin 2
262
- "R2", "1", # To component R2, pin 1
263
- routing_mode="manhattan", # Manhattan (L-shaped) routing
264
- avoid_components=True # Avoid component bounding boxes
265
- )
266
-
267
- # Direct routing (straight line)
268
- direct_wire = sch.auto_route_pins("C1", "1", "C2", "2", routing_mode="direct")
269
-
270
- # Manual obstacle avoidance using bounding boxes
271
- bbox_r1 = get_component_bounding_box(sch.components.get("R1"))
272
- bbox_r2 = get_component_bounding_box(sch.components.get("R2"))
273
-
274
- # Check if routing path intersects with component
275
- def path_clear(start, end, obstacles):
276
- # Custom collision detection logic
277
- return not any(bbox.intersects_line(start, end) for bbox in obstacles)
278
- ```
279
-
280
- ### Component Search and Management
281
-
282
- ```python
283
- # Search for components
284
- resistors = sch.components.find(lib_id_pattern='Device:R*')
285
- power_components = sch.components.filter(reference_pattern=r'U[0-9]+')
286
-
287
- # Bulk updates
288
- sch.components.bulk_update(
289
- criteria={'lib_id': 'Device:R'},
290
- updates={'properties': {'Tolerance': '1%'}}
291
- )
292
-
293
- # Component validation
294
- validation_result = sch.components.validate_component(
295
- 'Device:R',
296
- 'Resistor_SMD:R_0603_1608Metric'
297
- )
298
- ```
299
-
300
- ### Component and Element Removal
301
-
302
- ```python
303
- # Remove components by reference
304
- removed = sch.components.remove("R1") # Returns True if removed
305
-
306
- # Remove wires, labels, and other elements
307
- sch.remove_wire(wire_uuid)
308
- sch.remove_label(label_uuid)
309
- sch.remove_hierarchical_label(label_uuid)
310
-
311
- # Remove from collections
312
- sch.wires.remove(wire_uuid)
313
- sch.junctions.remove(junction_uuid)
314
-
315
- # lib_symbols are automatically cleaned up when last component of type is removed
316
- ```
317
-
318
- ### Configuration and Customization
319
-
320
- ```python
321
- import kicad_sch_api as ksa
322
-
323
- # Access global configuration
324
- config = ksa.config
325
-
326
- # Customize property positioning
327
- config.properties.reference_y = -2.0 # Move reference labels higher
328
- config.properties.value_y = 2.0 # Move value labels lower
329
-
330
- # Customize tolerances and precision
331
- config.tolerance.position_tolerance = 0.05 # Tighter position matching
332
- config.tolerance.wire_segment_min = 0.005 # Different wire segment threshold
333
-
334
- # Customize defaults
335
- config.defaults.project_name = "my_company_project"
336
- config.defaults.stroke_width = 0.1
337
-
338
- # Grid and spacing customization
339
- config.grid.unit_spacing = 10.0 # Tighter multi-unit IC spacing
340
- config.grid.component_spacing = 5.0 # Closer component placement
341
-
342
- # Sheet settings for hierarchical designs
343
- config.sheet.name_offset_y = -1.0 # Different sheet label position
344
- config.sheet.file_offset_y = 1.0 # Different file label position
345
- ```
346
-
347
- ### KiCAD Integration
348
-
349
- ```python
350
- # Run electrical rules check using KiCAD CLI
351
- erc_result = sch.run_erc_check()
352
- print(f"ERC Status: {erc_result.status}")
353
- for violation in erc_result.violations:
354
- print(f"- {violation.type}: {violation.message}")
355
-
356
- # Generate netlist for connectivity analysis
357
- netlist = sch.generate_netlist()
358
- net_info = netlist.analyze_net("VCC")
359
- ```
360
-
361
- ## 🤖 AI Agent Integration
362
-
363
- This library serves as the foundation for AI agent integration. For Claude Code or other AI agents, use the **[mcp-kicad-sch-api](https://github.com/circuit-synth/mcp-kicad-sch-api)** MCP server.
364
-
365
- ## 🏗️ Architecture
366
-
367
- ### Library Structure
368
-
369
- ```
370
- kicad-sch-api/
371
- ├── kicad_sch_api/ # Core Python library
372
- │ ├── core/ # Core schematic manipulation
373
- │ ├── library/ # KiCAD library integration
374
- │ ├── discovery/ # Component search and indexing
375
- │ └── utils/ # Validation and utilities
376
- ├── tests/ # Comprehensive test suite
377
- └── examples/ # Usage examples and tutorials
378
- ```
379
-
380
- ### Design Principles
381
-
382
- - **Building Block First**: Designed to be the foundation for other tools
383
- - **Exact Format Preservation**: Guaranteed byte-perfect KiCAD output
384
- - **Professional Quality**: Comprehensive error handling and validation
385
- - **MCP Foundation**: Designed as a stable foundation for MCP servers and AI agents
386
- - **Performance Optimized**: Fast operations on large schematics
387
-
388
- ## 🧪 Testing & Quality
389
-
390
- ```bash
391
- # Run all tests (29 tests covering all functionality)
392
- uv run pytest tests/ -v
393
-
394
- # Format preservation tests (critical - exact KiCAD output matching)
395
- uv run pytest tests/reference_tests/ -v
396
-
397
- # Component removal tests (comprehensive removal functionality)
398
- uv run pytest tests/test_*_removal.py -v
399
-
400
- # Code quality checks
401
- uv run black kicad_sch_api/ tests/
402
- uv run mypy kicad_sch_api/
403
- uv run flake8 kicad_sch_api/ tests/
404
- ```
405
-
406
- ### Test Categories
407
-
408
- - **Format Preservation**: Byte-for-byte compatibility with KiCAD native files
409
- - **Component Management**: Creation, modification, and removal of components
410
- - **Element Operations**: Wires, labels, junctions, hierarchical sheets
411
- - **Configuration**: Customizable settings and behavior
412
- - **Performance**: Large schematic handling and optimization
413
- - **Integration**: Real KiCAD library compatibility
414
-
415
- ## 🆚 Why This Library?
416
-
417
- ### vs. Direct KiCAD File Editing
418
- - **Professional API**: High-level operations vs low-level S-expression manipulation
419
- - **Guaranteed Format**: Byte-perfect output vs manual formatting
420
- - **Validation**: Real KiCAD library integration and component validation
421
- - **Performance**: Optimized collections vs manual iteration
422
-
423
- ### vs. Other Python KiCAD Libraries
424
- - **Format Preservation**: Exact KiCAD compatibility vs approximate output
425
- - **Modern Design**: Object-oriented collections vs legacy patterns
426
- - **AI Integration**: Purpose-built MCP server vs no agent support
427
- - **Professional Focus**: Production-ready vs exploration tools
428
-
429
- ## 🔗 Ecosystem
430
-
431
- This library serves as the foundation for specialized tools and MCP servers:
432
-
433
- ```python
434
- # Foundation library
435
- import kicad_sch_api as ksa
436
-
437
- # MCP servers and specialized libraries built on this foundation:
438
- # - mcp-kicad-sch-api: Full MCP server for AI agents
439
- # - kicad_sourcing_tools: Component sourcing extensions
440
- # - kicad_placement_optimizer: Layout optimization
441
- # - kicad_dfm_checker: Manufacturing validation
442
-
443
- # Foundation provides reliable schematic manipulation
444
- sch = ksa.load_schematic('project.kicad_sch')
445
-
446
- # All extensions use the same stable API
447
- # mcp_server.use_schematic(sch) # MCP server integration
448
- # sourcing.update_sourcing(sch) # Component sourcing
449
- # placement.optimize_layout(sch) # Layout optimization
450
-
451
- # Foundation ensures exact format preservation
452
- sch.save() # Guaranteed exact KiCAD format
453
- ```
454
-
455
- ## 📖 Documentation
456
-
457
- Full documentation is available at **[kicad-sch-api.readthedocs.io](https://kicad-sch-api.readthedocs.io/)**
458
-
459
- Quick links:
460
- - **[Getting Started Guide](https://kicad-sch-api.readthedocs.io/en/latest/GETTING_STARTED.html)**: Complete beginner's tutorial
461
- - **[API Reference](https://kicad-sch-api.readthedocs.io/en/latest/API_REFERENCE.html)**: Complete API documentation
462
- - **[Recipes & Patterns](https://kicad-sch-api.readthedocs.io/en/latest/RECIPES.html)**: Practical examples
463
- - **[Why Use This Library?](https://kicad-sch-api.readthedocs.io/en/latest/WHY_USE_THIS_LIBRARY.html)**: Value proposition and use cases
464
- - **[Architecture](https://kicad-sch-api.readthedocs.io/en/latest/ARCHITECTURE.html)**: Internal design details
465
- - **[Examples](examples/)**: Code examples and tutorials
466
-
467
- ## 🤝 Contributing
468
-
469
- We welcome contributions! Key areas:
470
-
471
- - KiCAD library integration and component validation
472
- - Performance optimizations for large schematics
473
- - Additional MCP tools for AI agents
474
- - Test coverage and format preservation validation
475
-
476
- See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
477
-
478
- ## 📄 License
479
-
480
- MIT License - see [LICENSE](LICENSE) for details.
481
-
482
- ## 🔗 Related Projects
483
-
484
- - **[mcp-kicad-sch-api](https://github.com/circuit-synth/mcp-kicad-sch-api)**: MCP server for AI agents built on this library
485
- - **[circuit-synth](https://github.com/circuit-synth/circuit-synth)**: High-level circuit design automation using this library
486
- - **[Claude Code](https://claude.ai/code)**: AI development environment with MCP support
487
- - **[KiCAD](https://kicad.org/)**: Open source electronics design automation suite
488
-
489
- ---
490
-
491
- **Professional KiCAD schematic manipulation for the AI age ⚡**
@@ -1,87 +0,0 @@
1
- kicad_sch_api/__init__.py,sha256=ofPkntVvSdgUnaguvhz6tMh556LfEnwxORpq3xPbj38,2919
2
- kicad_sch_api/cli.py,sha256=ZzmwzfHEvPgGfCiQBU4G2LBAyRtMNiBRoY21pivJSYc,7621
3
- kicad_sch_api/py.typed,sha256=e4ldqxwpY7pNDG1olbvj4HSKr8sZ9vxgA_2ek8xXn-Q,70
4
- kicad_sch_api/cli/__init__.py,sha256=mflSYoGLMJw2EFEByw9GD79pgj_Hebi6htJy7cKV5qM,952
5
- kicad_sch_api/cli/base.py,sha256=9Qpx8xKGmMovbUVaMEXYj-KjtlPKv57dNwnBcu_hnpE,9793
6
- kicad_sch_api/cli/bom.py,sha256=So3p5VFzjgkwnWP7OY80KG5iyFZgNTfWuJh1-tqbue0,5299
7
- kicad_sch_api/cli/erc.py,sha256=0qrJMsGL82cZxjTuMA5aIaxyaKeOqqPJrTzvRuItXl8,7181
8
- kicad_sch_api/cli/export_docs.py,sha256=gsFsHwcuL5EYgHW3l8udwjBw4dm1N4fnpvFoXqfVS38,8778
9
- kicad_sch_api/cli/netlist.py,sha256=iveRNY2LeC6A_naykmCDuJKleom2OFpwxhDfHxtbxmA,2686
10
- kicad_sch_api/cli/types.py,sha256=pybFjAFbKGiY8svAt52Sq_F--fz8f836vbyvO710G10,1131
11
- kicad_sch_api/collections/__init__.py,sha256=I3DSWk0XmGE8J1fcTtiYOETaWrY-fFJPlz3UGUK2qXY,627
12
- kicad_sch_api/collections/base.py,sha256=7p-WVLg-2_uBS7z7mzwkOpCMwlR_VJZGr2iW_Hd1K3Q,8386
13
- kicad_sch_api/collections/components.py,sha256=ofH3P38Ube3uxVvk_28gJwJPsdL6KA37rgxWNig6BGM,14023
14
- kicad_sch_api/collections/junctions.py,sha256=4bjuUKm-tCWSJJTtuPwgjYh0Xglg2SEG8IOAvhULgtg,11728
15
- kicad_sch_api/collections/labels.py,sha256=zg6_xe4ifwIbc8M1E5MDGTh8Ps57oBeqbS9MclrvxKU,12266
16
- kicad_sch_api/collections/wires.py,sha256=o2Y_KIwOmFMytdOc2MjgnoUrK4Woj7wR9ROj4uRTuY0,12394
17
- kicad_sch_api/core/__init__.py,sha256=ur_KeYBlGKl-e1hLpLdxAhGV2A-PCCGkcqd0r6KSeBA,566
18
- kicad_sch_api/core/component_bounds.py,sha256=Qc-Fazq_RvASVZ57eGg99NahCIgnWq8FFg1J4HfggK0,17917
19
- kicad_sch_api/core/components.py,sha256=LUSIxpb8t2LD3bzpObxDguRkFz8VKQqdR53oDZiX8lg,26052
20
- kicad_sch_api/core/config.py,sha256=ECR6WLrC8i0itxRLJAZN3TDthbtOfd5NwNbiU6TSlW4,6224
21
- kicad_sch_api/core/formatter.py,sha256=RGN1Y1Ne5uBhKU4XRINVBb0ph6pm5Khycdv352r3cDw,22207
22
- kicad_sch_api/core/geometry.py,sha256=27SgN0padLbQuTi8MV6UUCp6Pyaiv8V9gmYDOhfwny8,2947
23
- kicad_sch_api/core/ic_manager.py,sha256=Kg0HIOMU-TGXiIkrnwcHFQ1Kfv_3rW2U1cwBKJsKopc,7219
24
- kicad_sch_api/core/junctions.py,sha256=HdEdaqF5zzFIWuRhJ2HJnVqPah4KJGNmeNv2KzgmFZQ,4757
25
- kicad_sch_api/core/labels.py,sha256=roiwUrF-YWBOUMD-s2_eyL7x2efOhOde6WWoxI1b5JM,10358
26
- kicad_sch_api/core/nets.py,sha256=N1n6U7G7eXKRrc-osV48ReA6mOOLwn4TCwcNp2ISkNQ,9773
27
- kicad_sch_api/core/no_connects.py,sha256=6HCXzdVO124AdUUsQbCv9Y0f7KWmObkQ4OZLimYgET8,8548
28
- kicad_sch_api/core/parser.py,sha256=uvFVdSVzv5-RZmD_OKnqm51DIatFfsKF7NzLcWx4gfg,28761
29
- kicad_sch_api/core/pin_utils.py,sha256=XGEow3HzBTyT8a0B_ZC8foMvwzYaENSaqTUwDW1rz24,5417
30
- kicad_sch_api/core/schematic.py,sha256=W3URcKzjUrsTy3MfDejGuhuLmV2WM2YmFnGTihzGgt0,56489
31
- kicad_sch_api/core/texts.py,sha256=kBwUxwftqncl-yauiJjdnLXauV6EWq2oLhKw2bAxD_c,9990
32
- kicad_sch_api/core/types.py,sha256=Rx3Q9PTmzP2RYEJhnb3bw0Gs2N1Gvn27KOPtqTph0hU,15853
33
- kicad_sch_api/core/wires.py,sha256=lLqcpRodErD4fD4_VMB1HgC9ViPnYPGcT8b-N9S0q-g,7139
34
- kicad_sch_api/core/collections/__init__.py,sha256=i75_p9v330S2hxi4LrAGLmcVjrF8O0nTlGjCCjNbkq0,118
35
- kicad_sch_api/core/collections/base.py,sha256=H-g1SC7hKD5QvbXPKVQotCK2e5pn04-y1ipkBQGcy3I,7076
36
- kicad_sch_api/core/factories/__init__.py,sha256=qFx_rAgcTgWRZ572hvzzKNAze-jE0BOLqLrSFzj7T6M,130
37
- kicad_sch_api/core/factories/element_factory.py,sha256=VbyBlEuIkVGkKf4soVIT8XUlq-T0-SJ_8w38JBfUH_k,8059
38
- kicad_sch_api/core/managers/__init__.py,sha256=Ec9H9RSBFt2MeJIhnZFUN9sa2ql0BSrO8FNOa1XsXeU,731
39
- kicad_sch_api/core/managers/file_io.py,sha256=k7yAfOvS5SqHrn1bCOH_wmOqDQnQe25wvhSPDmI8Cjk,7670
40
- kicad_sch_api/core/managers/format_sync.py,sha256=ar0FfhwXrU2l5ATV0aW5KtVRfIM2iM1WoyGvXQh-ShY,16963
41
- kicad_sch_api/core/managers/graphics.py,sha256=-jd-JL1TOuDntNEQcSeJ56Ccrkuudmj1dJkRtLUtRog,18370
42
- kicad_sch_api/core/managers/metadata.py,sha256=9oJK8UgnzpjDwZ-46I1eW3_P9ZoJsDvutEsgROFmTwc,8004
43
- kicad_sch_api/core/managers/sheet.py,sha256=jnnEBon0QmMh22-Ls7ZP5A_4FxM7bCyaJOF9AzZT1Kg,14816
44
- kicad_sch_api/core/managers/text_elements.py,sha256=utZIg488x9NLQID6ALbOcI0ZM2PfvgADVJ1jcbGP9jk,17319
45
- kicad_sch_api/core/managers/validation.py,sha256=-ZP_9odFsBmFG4CkNc00ZJq6bm_VtyjJHYDkMDku3l4,15757
46
- kicad_sch_api/core/managers/wire.py,sha256=WZSycnkI7CCBTsYKai7TPBULXi0gs2XE1Xxs-d87IfU,12027
47
- kicad_sch_api/discovery/__init__.py,sha256=qSuCsnC-hVtaLYE8fwd-Gea6JKwEVGPQ-hSNDNJYsIU,329
48
- kicad_sch_api/discovery/search_index.py,sha256=KgQT8ipT9OU6ktUwhDZ37Mao0Cba0fJOsxUk9m8ZKbY,15856
49
- kicad_sch_api/geometry/__init__.py,sha256=hTBXkn8mZZCjzDIrtPv67QsnCYB77L67JjthQgEIX7o,716
50
- kicad_sch_api/geometry/font_metrics.py,sha256=3f5_9ifxtDUigLDiafglO2pCgPE7JFDKqa-0uhLPkoQ,839
51
- kicad_sch_api/geometry/symbol_bbox.py,sha256=3zd9-M9ehue5_-Gpdm_Yht4W49CbE0YRsAhAzfqJGEg,24161
52
- kicad_sch_api/interfaces/__init__.py,sha256=ukuLgCT16e0sPLmrGb4HB_3DhGU1YriDEkeRgEBsQIA,435
53
- kicad_sch_api/interfaces/parser.py,sha256=J-b0czz1q_O81HlvIp3dHx53cm8UGSgQTd4xe5tBszk,2008
54
- kicad_sch_api/interfaces/repository.py,sha256=wFnWUCut6wPV9yDDE9k6zkhhijRnflbLteeXYtcU-gM,1763
55
- kicad_sch_api/interfaces/resolver.py,sha256=2_3et6VVnyZZ8VI5i-Q4C-4bBXKTAgYAEFxAFuOWEGw,2936
56
- kicad_sch_api/library/__init__.py,sha256=NG9UTdcpn25Bl9tPsYs9ED7bvpaVPVdtLMbnxkQkOnU,250
57
- kicad_sch_api/library/cache.py,sha256=7na88grl465WHwUOGuOzYrrWwjsMBXhXVtxhnaJ9GBY,33208
58
- kicad_sch_api/parsers/__init__.py,sha256=4TFc2duJMy6iRuk2dYbW4b7s-9H525iAsGU674_2a-E,357
59
- kicad_sch_api/parsers/base.py,sha256=vsKGxZkdzTNqrdbRPx11D4b3ebDm3LW65v2Xf4Q06_c,4569
60
- kicad_sch_api/parsers/registry.py,sha256=LoPvWIiGYysvTRtFfd8kWCXE0i535hoKYpdKs49Ygjs,5098
61
- kicad_sch_api/parsers/utils.py,sha256=54n1gWQJMoQItB2FcQVHovwsqMq_h9aZvZBhSaOmc-I,2330
62
- kicad_sch_api/parsers/elements/__init__.py,sha256=Av9oXw5uLsEkRsyWzLWsOgZ0UOrgkAhE4NDfdUUViV8,699
63
- kicad_sch_api/parsers/elements/graphics_parser.py,sha256=1dnt8OF9lsx6zrlJk7_s4ceZJ4U3-u-hHKqlZFBMT7U,23375
64
- kicad_sch_api/parsers/elements/label_parser.py,sha256=KL_AV_-BhA_KV1FLlqNpMj1Nu-gHLscjqQ4NePv4elk,7249
65
- kicad_sch_api/parsers/elements/library_parser.py,sha256=qHQMI3PatLgHtUWvWhQxbKC-NXJqgOVW33hVkMQ9sEU,6321
66
- kicad_sch_api/parsers/elements/metadata_parser.py,sha256=IFpgk5eLqp1kcjhpZB-jPThBCVyvdgsLo4YRydlvYD4,1897
67
- kicad_sch_api/parsers/elements/sheet_parser.py,sha256=xZld-yzW7r1FKABaK89K7U-Zenqz2cHUqtMnADhxCeQ,14246
68
- kicad_sch_api/parsers/elements/symbol_parser.py,sha256=nIKCZ67CLFHo6m62Xw2rLcOtjGLpyq0LhBdd0fPDiiY,12187
69
- kicad_sch_api/parsers/elements/text_parser.py,sha256=n5G_3czchmPCEdvTVoQsATTW1PQW7KcSjzglqzPlOKQ,9820
70
- kicad_sch_api/parsers/elements/wire_parser.py,sha256=geWI3jMXM7lZF26k7n7c6RQ55x4gsO4j8Ou0fk0O2j8,8271
71
- kicad_sch_api/symbols/__init__.py,sha256=NfakJ5-8AQxq5vi8nZVuaUtDpWHfwHm5AD4rC-p9BZI,501
72
- kicad_sch_api/symbols/cache.py,sha256=pKFjmuyId-9gGPAue-1Rzy4MRsecoC4TMn0hn2n0Yqk,16204
73
- kicad_sch_api/symbols/resolver.py,sha256=w0jqepp9RwWqlwQHX28FpTn1aSz8iOf7kcJUOBMHwqE,12074
74
- kicad_sch_api/symbols/validators.py,sha256=5Ryt4rLHxDF3ALViaNLRrI3pYvOreVT51gpvhECTZms,17216
75
- kicad_sch_api/utils/__init__.py,sha256=1V_yGgI7jro6MUc4Pviux_WIeJ1wmiYFID186SZwWLQ,277
76
- kicad_sch_api/utils/validation.py,sha256=XlWGRZJb3cOPYpU9sLQQgC_NASwbi6W-LCN7PzUmaPY,15626
77
- kicad_sch_api/validation/__init__.py,sha256=YZ2KDTpBN9BloD7I__gsw6IiW-g5tZPux0kgyXb3TjU,524
78
- kicad_sch_api/validation/erc.py,sha256=6WMHyMakKpn1-jXkfO9ltayLRA0OaU1N7GQm-pbZTLg,5160
79
- kicad_sch_api/validation/erc_models.py,sha256=wFYMH-cbcdRX1j9LPn28IGUYBLioPDr4lP0m2QuhAnI,6628
80
- kicad_sch_api/validation/pin_matrix.py,sha256=AdBCvEmOByXACOUoskYxYMcwKvIasxrtJOqWM-WgVi0,7456
81
- kicad_sch_api/validation/validators.py,sha256=3txkQpR3qAUzp0-m-FnDYf3-_GGj6iaGZj4kSYu-Fe4,13166
82
- kicad_sch_api-0.4.1.dist-info/licenses/LICENSE,sha256=Em65Nvte1G9MHc0rHqtYuGkCPcshD588itTa358J6gs,1070
83
- kicad_sch_api-0.4.1.dist-info/METADATA,sha256=y4meDeK6RX_G6PCcQ7pIBw-pgKZv2NzG8kvMGsEusQw,17953
84
- kicad_sch_api-0.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
85
- kicad_sch_api-0.4.1.dist-info/entry_points.txt,sha256=VWKsFi2Jv7G_tmio3cNVhhIBfv_OZFaKa-T_ED84lc8,57
86
- kicad_sch_api-0.4.1.dist-info/top_level.txt,sha256=n0ex4gOJ1b_fARowcGqRzyOGZcHRhc5LZa6_vVgGxcI,14
87
- kicad_sch_api-0.4.1.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- kicad-sch-api = kicad_sch_api.cli:main