You could run the mibbuild.py --destination-format json tool over all your MIBs. You will get one JSON document for each of your MIB files. The JSON documents will look like this:
"coldStart": {
"name": "coldStart",
"oid": "1.3.6.1.6.3.1.1.5.1",
"class": "notificationtype",
"status": "current"
},
From here you can load JSON into Python, create a new dict
like {json[key]['oid']: key for key in json}
which you could use for looking up TRAP names by OID.
If your collection of MIBs is changing and needs constant updates, you can build the above procedure into your application by calling pysmi functions.
EDIT:
If you need to resolve whatever TRAP OID into its MIB name, you can grab as many MIBs as you can find on the Internet and run the above procedure over them. However you still may not be able to resolve all TRAP OIDs you encounter in the wild. It is more typical to have MIBs for all the devices your software is managing.
The default for the mibdump
tool is to pull requested MIBs from http://mibs.snmplabs.com/asn1/ site.