https://pypi.python.org/pypi/python-mimeparse
A module provides basic functions for parsing mime-type names and matching them against a list of media-ranges.