For example if i had to convert text to hex i can use
import binascii
x = input()
print(str(binascii.b2a_hex(x.encode("utf-8")))[2:-2])
But I cant do that for octal.
It's a great question, my mind went to something like this
x=[chr(x) for x in range(97,123)]
y=[oct(ord(i)) for i in x]
print(dict(zip(x,y)))