The PZM Pi Zero Motor Shim is a brilliant way to adding motor control to (almost) any Raspberry Pi project. Although specifically designed for use with the Raspberry Pi Zero, the board can be used with any other Pi. When fitted, the board provides dual H-Bridge control of two DC motors. The board is so small (38 x 16 x 0.8mm) that it can be soldered onto the bottom of the connector (assuming you have added one to your Pi Zero), or you can solder on the female or male headers included in the kit so you can connect and remove it, however you have configured your Pi Zero.
Included in the kit are the ready assembled PZM Shim, 3x screw terminals, 3 x 2 male header, 3 x 2 female header. The board can be powered from an external 3 to 11V supply or, if you are using low power motors, you can use 5V from the Pi. The pzm.py library module provides basic functions for forward, reverse, spin left, spin right, turn left/right forward, turn left/right reverse. Download library and examples from here.