A command-line PCB place & route tool with autorouting and DRC.
Project description
Pardal PCB
A command-line PCB Place & Route tool.
Features
- 17 Commands: LOAD, SAVE, MOVE, ROTATE, FLIP, LOCK, UNLOCK, LIST (components/nets), SHOW BOARD, WHERE, UNDO, REDO, HISTORY, HELP, EXIT
- Autorouting: A* pathfinding with Z3 layer optimization for 2-layer boards, largely based on some of freerouting project features.
- CLI Modes: Interactive REPL, batch file execution (
--batch), single command execution (--exec) - File Formats: Reads KiCad netlist (.net), writes KiCad PCB (.kicad_pcb)
- SDK Workflow: Generate production-quality boards with library footprints, aiming at 0 DRC errors
- Grid Visualization: ASCII art board display with component positions and orientations
- Undo/Redo: Full command history with state management
Dependencies
Required
- Python 3.10+ with virtual environment
- KiCad 9.0+ installed (provides
pcbnewPython module andkicad-cli) - kicad-packages3d package for 3D model rendering in KiCad viewer
Install on Debian/Ubuntu:
sudo apt install kicad kicad-packages3d
For SDK Workflow (Recommended)
The SDK workflow uses KiCad's Python API directly (system Python, not venv):
python3 -c "import pcbnew; print(pcbnew.Version())"
Installation
No installation needed - uses virtual environment:
cd pardal-pcb
./venv/bin/python -m pcb_tool --help
Quick Start
# Install
pip install -e .
# Show available commands
pardal --help
# Build PCB from netlist with placement
pardal build project.net -p placement.txt -o board.kicad_pcb
# Run DRC check
pardal drc board.kicad_pcb
# Interactive mode
pardal repl
CLI Commands
| Command | Description |
|---|---|
pardal build |
Load netlist, place components, optionally route, save PCB, run DRC |
pardal drc |
Run KiCad DRC check on existing PCB file |
pardal place |
Place components from netlist (no routing) |
pardal route |
Autoroute existing PCB file |
pardal repl |
Interactive REPL mode |
Examples
# Full build with autorouting
pardal build project.net -p placement.txt -o board.kicad_pcb --route
# Build without DRC check
pardal build project.net -o board.kicad_pcb --no-drc
# Check DRC and save JSON report
pardal drc board.kicad_pcb -o report.json --format json
# Run batch commands
pardal repl --batch commands.txt
Interactive Mode
./venv/bin/python -m pcb_tool
pcb> HELP
pcb> LOAD ../manual_temp_test/example.net
pcb> LIST COMPONENTS
pcb> MOVE U1 TO 10 20
pcb> AUTOROUTE ALL
pcb> SHOW BOARD
pcb> SAVE output.kicad_pcb
pcb> EXIT
Batch Mode
./venv/bin/python -m pcb_tool --batch placement.txt
Command Execution
./venv/bin/python -m pcb_tool --load example.net --exec "MOVE U1 TO 10 20" --exec "SAVE output.kicad_pcb"
DRC Validation
Important: The internal CHECK DRC command performs basic connectivity checks only. For full DRC validation matching KiCad's standards, use kicad-cli:
kicad-cli pcb drc --output drc_report.txt board.kicad_pcb
This runs KiCad's complete DRC engine including clearance, copper pour, footprint, and electrical rule checks.
SDK Workflow (Recommended)
For production-quality boards with proper footprints and 0 DRC errors, use the SDK-based workflow:
- Route board using pardal-pcb's autorouter
- Regenerate with SDK to get library footprints with full graphics/3D models
- Add zones for copper pours
- Validate with
kicad-cli pcb drc
See docs/SDK_WORKFLOW_GUIDE.md for complete instructions.
Documentation
- USAGE.md: Complete command reference with examples
- docs/AUTOROUTING_GUIDE.md: Autorouting system guide
- docs/SDK_WORKFLOW_GUIDE.md: SDK workflow for production boards
Testing
Run the full test suite:
./venv/bin/pytest tests/ -v
Architecture
- Command Pattern: All operations as reversible command objects
- Vertical Slices: End-to-end features over horizontal layers
- Clean Separation: Data model, commands, parsers, I/O handlers
Limitations
- 2-layer boards only: F.Cu and B.Cu layers supported
- Linux paths: Footprint library paths assume standard KiCad installation at
/usr/share/kicad/footprints/ - KiCad 9+: Requires KiCad 9.0 or newer for SDK compatibility
License
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
See LICENSE for the full license text.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pardal-0.1.1.tar.gz.
File metadata
- Download URL: pardal-0.1.1.tar.gz
- Upload date:
- Size: 192.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33bf317f4ab5855d92fa5f0423f9edfa14de83ffa9fdb68d0a934ebb887ed1b3
|
|
| MD5 |
14ac62601a7b721bb901143f75ebe982
|
|
| BLAKE2b-256 |
d2fad02792392ee3d16dba78c021729a0d7f7931efc474bdfdc028c08ed5454f
|
File details
Details for the file pardal-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pardal-0.1.1-py3-none-any.whl
- Upload date:
- Size: 110.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f116e1ffab40fdaaee356a26f3a838c19b7597cf3e6a3a0581747103bf6c8af6
|
|
| MD5 |
2a6403fe191e2c6ea5b7dafc2a12e778
|
|
| BLAKE2b-256 |
b636496eb00b8a2c479f40fb78c4bd27dde25ecde763ea4a43d04e801a26f62d
|