# bidict: The Bidirectional Mapping Library for Python

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/jab-bidict
Generated for open source discovery and AI-assisted research.

bidict is a mature and lightweight Python library designed for creating bidirectional mappings. It provides familiar, Pythonic APIs for safe, simple, and flexible data handling, making it a reliable choice for projects requiring efficient two-way lookups. Trusted by major organizations since 2009, bidict ensures robust and well-tested functionality.

GitHub: https://github.com/jab/bidict
OSRepos URL: https://osrepos.com/repo/jab-bidict

## Summary

bidict is a mature and lightweight Python library designed for creating bidirectional mappings. It provides familiar, Pythonic APIs for safe, simple, and flexible data handling, making it a reliable choice for projects requiring efficient two-way lookups. Trusted by major organizations since 2009, bidict ensures robust and well-tested functionality.

## Topics

- bidict
- bimap
- data-structures
- python
- python-library
- mapping
- two-way-dict

## Repository Information

Last analyzed by OSRepos: Mon Apr 06 2026 00:13:08 GMT+0100 (Western European Summer Time)
Detail views: 3
GitHub clicks: 15

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction
bidict is a robust Python library that provides bidirectional mapping capabilities, allowing you to easily look up values by keys and keys by values. Since its inception in 2009, it has been a trusted solution, relied upon by major organizations like Google, Venmo, CERN, Baidu, and Tencent for their data structure needs.

## Installation
To get started with bidict, simply install it using pip:

bash
pip install bidict


## Examples
Here's a quick example to demonstrate bidict's core functionality:

python
from bidict import bidict

element_by_symbol = bidict({'H': 'hydrogen'})
print(element_by_symbol['H'])
print(element_by_symbol.inverse['hydrogen'])


## Why Use bidict?
bidict stands out for several reasons:

*   **Mature and Trusted:** With over a decade of development, it's a proven solution used by leading companies.
*   **Pythonic APIs:** Designed for safety, simplicity, flexibility, and ergonomics, making it intuitive for Python developers.
*   **Lightweight:** It has no runtime dependencies beyond Python's standard library.
*   **High Quality Code:** Implemented in concise, fully type-hinted Python, optimized for efficiency and long-term stability.
*   **Extensive Documentation:** Comprehensive documentation is available to help you get the most out of the library.
*   **100% Test Coverage:** Ensures reliability across all supported Python versions, including property-based tests and benchmarks.

## Links
For more information, documentation, and to contribute, check out these official links:

*   [GitHub Repository](https://github.com/jab/bidict)
*   [Official Documentation](https://bidict.readthedocs.io)
*   [PyPI Page](https://pypi.org/project/bidict)