An fdisk(1) clone, implemented in pure Python using PyParted library (https://fedorahosted.org/pyparted/).
It misses some features (see comments inside) and not 100% identical to the original, but close enough to be non-trivial.
fdisk.py was developed as an example code for a PyParted tutorial. It was written for simplicity, not features or stability you'd expect from conventional partitioning software, and is hardly suitable for the production use.