How to rotate a footprint in KiCad using Python?
To rotate a footprint in KiCad using Python, you can use the pcbnew module. Here's a simple script:

```python
import pcbnew

# Load the current board
board = pcbnew.GetBoard()

# Find the footprint
footprint_ref = 'R1' # Replace with your footprint reference
footprint = board.FindFootprintByReference(footprint_ref)

# Check if the footprint exists
if footprint:
    # Rotate the footprint by 90 degrees
    footprint.Rotate(pcbnew.wxPoint(0,0), 900) # Rotation angle is in tenths of degrees
    board.Save('path/to/save/your/pcb.kicad_pcb')
else:
    print('Footprint not found')
```

This script rotates a specified footprint by 90 degrees on the current PCB.