Registry / serialization / orderedmultidict

orderedmultidict

JSON →
library1.0.2pypypi✓ verified 24d ago

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.

pip install orderedmultidict
INSTALL
IMPORT
SIG · ORDEREDMULTIDICT
O
orderedmultidict
serializationpythonv1.0.2
Install
1.8s avg
Import
18ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.018s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.018s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

omdict
from orderedmultidict import omdict

Demonstrates basic instantiation, adding multiple values to a key, and accessing values while preserving insertion order.

from orderedmultidict import omdict # Create an empty ordered multivalue dictionary omd = omdict() # Add values for keys omd[1] = 'apple' omd.add(2, 'banana') omd.add(1, 'apricot') # Add another value for key 1 # Access values print(omd[1]) # Accesses the first value for key 1: 'apple' print(omd.getlist(1)) # Gets all values for key 1: ['apple', 'apricot'] # See insertion order print(list(omd.keys())) # Keys in insertion order: [1, 2, 1] print(list(omd.items())) # Items in insertion order: [(1, 'apple'), (2, 'banana'), (1, 'apricot')]
Debug
Known issues
gotchaThe `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.
fix
Consider migrating to more actively maintained alternatives if long-term support or compatibility with recent Python versions is required.
affects: <=1.0.2
gotchaPerformance 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.
fix
For performance-critical applications, evaluate alternatives like `better-orderedmultidict` (PyPI: `better-orderedmultidict`) or `werkzeug.datastructures.MultiDict`, which offer improved speed and active development.
affects: <=1.0.2
gotchaSince 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.
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.
affects: <=1.0.2
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'orderedmultidict'
The 'orderedmultidict' package is not installed in the Python environment.
fix
Install the package using pip: `pip install orderedmultidict`
NameError: name 'omdict' is not defined
The `omdict` class was used without being correctly imported from the `orderedmultidict` library.
fix
Import the `omdict` class explicitly: `from orderedmultidict import omdict`
Retrieving only the last value for a key in orderedmultidict (e.g., `omd[key]` returns one value, not a list)
Unlike a standard dictionary, `orderedmultidict`'s `omdict[key]` access returns only the *last* value associated with that key, similar to Python's built-in `dict` behavior. Users often expect it to return all values due to its 'multivalue' nature.
fix
Use the `getlist()` method to retrieve all values associated with a key as a list: `omd.getlist(key)`
KeyError: 'some_key'
Attempting to access a non-existent key in an `omdict` instance using square bracket notation (`omd[key]`) will raise a `KeyError`.
fix
Before accessing a key, check if it exists using `if key in omdict_instance:` or use the `get()` method with a default value: `omd.get(key, default_value)`
Upgrade
Version history
1.0.2latest on PyPI · released Nov 18, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
orderedmultidict — pip install orderedmultidict · libregistry