The PIL library is not the best choice for editing EXIF metadata because it recompresses the image when saving. This means that after multiple modifications of a JPEG image, compression artifacts may appear.
A better alternative is the exiv2 library. It is well-documented, production-ready, and modifies only the metadata without recompressing the image, preserving its original quality.