import mimetypes mimetypes.init() for map in mimetypes._db.types_map: for k, v in sorted(map.items()): print ("%s => %s" % (k, v))