{"id":2173,"library":"orderedmultidict","title":"Ordered Multivalue Dictionary","description":"orderedmultidict is a Python library that provides an `omdict` class, an ordered multivalue dictionary. It retains the insertion order of both keys and their associated values, and aims for method parity with Python's built-in `dict`. The library is known for powering `furl` and supports both Python 2 and Python 3 environments. The current version is 1.0.2, with the last release dating back to 2019, indicating an infrequent release cadence.","status":"maintenance","version":"1.0.2","language":"en","source_language":"en","source_url":"https://github.com/gruns/orderedmultidict","tags":["dict","multidict","ordered","data-structure","legacy"],"install":[{"cmd":"pip install orderedmultidict","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"omdict","correct":"from orderedmultidict import omdict"}],"quickstart":{"code":"from orderedmultidict import omdict\n\n# Create an empty ordered multivalue dictionary\nomd = omdict()\n\n# Add values for keys\nomd[1] = 'apple'\nomd.add(2, 'banana')\nomd.add(1, 'apricot') # Add another value for key 1\n\n# Access values\nprint(omd[1]) # Accesses the first value for key 1: 'apple'\nprint(omd.getlist(1)) # Gets all values for key 1: ['apple', 'apricot']\n\n# See insertion order\nprint(list(omd.keys())) # Keys in insertion order: [1, 2, 1]\nprint(list(omd.items())) # Items in insertion order: [(1, 'apple'), (2, 'banana'), (1, 'apricot')]","lang":"python","description":"Demonstrates basic instantiation, adding multiple values to a key, and accessing values while preserving insertion order."},"warnings":[{"fix":"Consider migrating to more actively maintained alternatives if long-term support or compatibility with recent Python versions is required.","message":"The `orderedmultidict` library has not seen updates since its 1.0.2 release in July 2019. This means it may not be compatible with newer Python versions beyond 3.9 (as listed on PyPI) and is unlikely to receive bug fixes or new features, potentially leading to compatibility issues or unaddressed vulnerabilities in modern environments.","severity":"gotcha","affected_versions":"<=1.0.2"},{"fix":"For performance-critical applications, evaluate alternatives like `better-orderedmultidict` (PyPI: `better-orderedmultidict`) or `werkzeug.datastructures.MultiDict`, which offer improved speed and active development.","message":"Performance of `orderedmultidict` (omdict) can be significantly slower compared to more optimized alternatives, especially for operations like initialization and iteration over items. Benchmarks suggest an order of magnitude difference in some cases.","severity":"gotcha","affected_versions":"<=1.0.2"},{"fix":"For scenarios only requiring ordered keys with single values, a standard `dict` in Python 3.7+ may suffice. For multi-value requirements, assess if a `dict` of lists adequately meets needs before opting for a specialized multidict.","message":"Since Python 3.7, built-in `dict` objects officially preserve insertion order for keys. While `orderedmultidict` provides additional functionality for multiple values per key and preserves the order of *individual values* as well, the 'ordered' aspect for single-value entries is less unique than it once was.","severity":"gotcha","affected_versions":"<=1.0.2"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}