Registry / serialization / ordereddict

ordereddict

JSON →
library1.1pypypiunverified

The 'ordereddict' library provides a backport of the `collections.OrderedDict` class, originally introduced in Python 2.7 and 3.1, for use in older Python 2.x environments (specifically Python 2.4, 2.5, and 2.6). It enables maintaining the insertion order of keys in a dictionary-like structure. This package is no longer maintained and serves only historical compatibility purposes for very old Python 2 projects.

pip install ordereddict
INSTALL
IMPORT
SIG · ORDEREDDICT
O
ordereddict
serializationpythonv1.1
Install
2.4s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1 · 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.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.2MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.4s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

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

OrderedDict
from ordereddict import OrderedDict
import ordereddict

Demonstrates importing and using the `OrderedDict` class from the backport for Python 2.4-2.6. It includes a version check to highlight the library's specific compatibility window.

import sys # This library is for Python 2.x <= 2.6 # For Python 2.7+ or 3.x, use 'from collections import OrderedDict' if sys.version_info < (2, 7) and sys.version_info >= (2, 4): from ordereddict import OrderedDict print("Using ordereddict backport") od = OrderedDict() od['first'] = 1 od['second'] = 2 od['third'] = 3 print(od.items()) else: print("This library is not needed for your Python version.") print("Use 'from collections import OrderedDict' instead.")
Debug
Known issues
breakingThis 'ordereddict' library is obsolete for modern Python versions. `collections.OrderedDict` is built into Python 2.7, Python 3.1, and later. Furthermore, standard Python dictionaries (`dict`) guarantee insertion order since Python 3.7.
fix
For Python 2.7+, use `from collections import OrderedDict`. For Python 3.7+, a regular `dict` maintains insertion order, so `OrderedDict` might only be needed for specific API compatibility or advanced features like `move_to_end` or order-sensitive equality comparisons.
affects: Python 2.7+, Python 3.x
gotchaThe performance characteristics of this Python-based backport `ordereddict.OrderedDict` may differ significantly from the C-optimized `collections.OrderedDict` in newer Python versions.
fix
Avoid using this backport unless strictly required for compatibility with Python 2.4-2.6. Prioritize `collections.OrderedDict` or standard `dict` where possible.
affects: All versions
Upgrade
Version history
1.1latest on PyPI · released Oct 28, 2010
Audit
Dependencies

No dependency data recorded yet.

Agent activity
22 hits · last 30 days
node
22
Resources
homepageUNKNOWN
ordereddict — pip install ordereddict · libregistry