Efficient, Pythonic bidirectional map implementation and related functionality.

bidict logo


Latest release Documentation Build status Test coverage Supported Python implementations License Chat

The bidict codebase is mature, well-tested, and well-reviewed. It is in use by several teams at Google, Bank of America Merill Lynch, and other developers all over the world.

If you are thinking of using bidict in your work, or if you have any questions, comments, or suggested improvements, please let me know! I’d love to know about and be able to support your use case as much as possible.

Please also feel free to file an issue or submit a pull request. All contributions are gratefully received:) (See contributing below.)

Release Notifications

Follow on VersionEye

Tip: Follow bidict on VersionEye to automatically be notified via email when a new version of bidict is released.


pip install bidict

Usage Documentation

For usage documentation, please start at the Introduction and proceed from there.


If you’re reading this on GitHub, PyPI, in your code editor, or in some other place that can’t render/link the full docs properly, you can find the bidict documentation on Read the Docs at:

Also note: multiple versions of the documentation are published on Read the Docs, and by default you will be taken to the version built from the master branch. You can choose different versions from the pop-up menu in the lower-right.

If you have the bidict source code handy, you can also browse the docs inside the docs directory, and build them yourself by running make html from within that directory (requires Sphinx).


For information about contributing, please see the Contributors’ Guide (CONTRIBUTING.rst |

If bidict has helped you accomplish your work, especially work you’ve been paid for, please consider supporting bidict’s maintenance and development.

Support bidict


For a history of notable changes to bidict, check out the Changelog (CHANGELOG.rst |