Introducing pyCoup
Posted on April 22, 2026Coup is one of my favorite board games. It's a game where you, the players, are politicians. ....corrupt politicians! The objective of the game is to expose the other players as more corrupt than you.

Here is a pristine image of the game box taken from boardgamegeek. It looks nice.
Now, here's my box after 11+ years 1.

You can see the cover have seen better days, the box have been sat on, the flap at the back is broken, and I'm missing one reference sheet.
How did my game became like this?
You see, I take this whenever I give talks or Python workshops. It's one of my go to for introducing boardgames to new players. I love seeing their eyes light up as I explain the game and realize how they can expose their friends. As a bonus, I also love the idea that after hours of teaching them Python, I would spend some time teaching them how to cheat, how to lie, ...how to steal!
Python implementation
Now, as someone who played the games a lot, I've decided to apply my knowledge and created a Python implementation. When I started this, it was to practice automated unit testing.
The unit tests in this project had edge case rules like having a bluffed Assassin return their money when called out, or having an Assassin kill two influences when a bluffed Contessa is called out.
I was planning to make an AI to play the game (this was back in 2015, before generative AI became more accessible), but like a lot of projects, I've moved on to other works.
Project revival
It was during the PythonAsia 2026 Sprint that I've decided to revive this project.
One of the reasons I've chosen this old project as my Sprint submission is because pydanny is at the event and I thought it'll be funny to resolve an 11+ year old issue. Also, I was thinking of making a frontend using Air.

I took some time to review my code (I was a little distracted by also running PythonAsia Sprints). It was not fun to look at old code. I wouldn't write code this way anymore.
While working on this, one of my friends, BJ saw my project. He is a fellow boardgamer, and he offered to help modernize my code by adding tools and formatting fixes. Suddenly, my personal project became an open source project.
You can try PyCoup right now with the following commands:
$ pip install pycoup
$ python -m pycoup
Plans for the future
- Implement the frontend using Air
- Refactor the code to allow for expansions
- Dockerize and host the server somewhere.
- Implement AI
Here's to hoping I won't take too long to do these.
[1]: I can't remember when I brought this, but I know it was years before I started work on pyCoup.