bidict
The bidirectional mapping library for Python
...Familiar, Pythonic APIs that are carefully designed for safety, simplicity, flexibility, and ergonomics. Lightweight, with no runtime dependencies outside Python's standard library. Implemented in concise, well-factored, fully type-hinted Python code that is optimized for running efficiently as well as for long-term maintenance and stability. Extensively documented. 100% test coverage running continuously across all supported Python versions. Enterprise-level support for bidict can be obtained via the Tidelift subscription. One of the best things about bidict is that it touches a surprising number of interesting Python corners, especially given its small size and scope. ...