Bimap Bimap is a bidirectional dictionary, similar to boost bimap. Usage from bimap import Bimap bm = Bimap() bm.left[1] = 'a' bm.left[2] = 'b' bm.left[3] = 'c' assert bm.left[2] == 'b' assert bm.right['c'] == 3 Installation pip install bimap