I am writing Python code in which a user inputs a SNMP OID in any of the following forms:
NetSnmp provides a
snmptranslate method - that may be useful starting point.
Its man page says its purpose is to:
translate MIB OID names between numeric and textual forms.
There are already Python bindings for
net-snmp available, see these SO questions.
Alternatively pysnmp provides similar. See SO question "Translating pysnmp numerical oid output into symbolic names".