PyKML is a Python package for authoring, parsing, and manipulating KML documents. It is based on the lxml library (http://codespeak.net/lxml/) which provides a Python API for working with XML documents.
git clone https://github.com/yunjunz/pykml.git; cd pykml
python3 setup.py build
python3 setup.py install