Who wouldn’t love to build a TrafficHat! Find out where to get one for your Raspberry Pi and how to go on assembling it and programming it.
Here you can find Ryan’s documentation on his Wiki and the test code I have used for the traffic light
Also if you need to install GPIO Zero:
sudo apt-get install python-gpiozero
or for Python 3
sudo apt-get install python3-gpiozero