See docs at http://daler.github.io/gffutils.
gffutils is a Python package for working with and manipulating the GFF and
GTF format files typically used for genomic annotations. Files are loaded into
a sqlite3 database, allowing much more complex manipulation of hierarchical
features (e.g., genes, transcripts, and exons) than is possible with plain-text