Registry / data / zope-sequencesort

zope-sequencesort

JSON →
library6.0pypypi✓ verified 84d ago

Provides support for sorting sequences by one or more criteria, including ascending/descending order and case-insensitive comparisons. Current version: 6.0 (requires Python >=3.9). Maintained as part of the Zope Foundation, releases are stable but infrequent.

pip install zope-sequencesort
INSTALL
IMPORT
SIG · ZOPE-SEQUENCESORT
Z
zope-sequencesort
datapythonv6.0
Install
1.8s avg
Import
10ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v6.0 · 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.006s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.002s · 18MB
19MB installed
● package 19MB
Code
Verified usage

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

sort
from zope.sequencesort import sort

Sort a list of dicts by a key, with options for descending and case-insensitive.

from zope.sequencesort import sort # Simple list of dictionaries items = [{'name': 'Charlie'}, {'name': 'Alice'}, {'name': 'Bob'}] # Sort by 'name' ascending, case-insensitive sorted_items = sort(items, (('name', False, False),)) print([item['name'] for item in sorted_items]) # Output: ['Alice', 'Bob', 'Charlie']
Debug
Known issues
gotchaThe sort function expects a sequence and a tuple of sort keys. Each sort key is a tuple of (attr, reverse, case_insensitive). The default for both reverse and case_insensitive is False, but you must pass a tuple for each key.
fix
Ensure you pass a tuple of tuples, e.g., (('name', False, False),). Do not pass a single tuple without the outer parentheses.
affects: all
gotchaThe sort key's first element is an attribute name (string) used for getattr. It does not work for nested attributes or item access like 'key.subkey'.
fix
Pre-process your data to flatten nested structures before sorting, or use a lambda with Python's sorted().
affects: all
gotchaThe package is very old and may not be compatible with Python 3.10+ if using deprecated 'distutils'. However, version 6.0 requires Python >=3.9 and should work.
fix
If you encounter install errors, upgrade pip and setuptools, or use a virtual environment.
affects: >=6.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'zope.sequencesort'
Package not installed or wrong import path.
fix
Install with 'pip install zope-sequencesort' and import as 'from zope.sequencesort import sort'.
TypeError: sort() argument 2 must be tuple, not tuple
Passing a single sort key tuple instead of a tuple containing that tuple.
fix
Wrap the key tuple in an extra set of parentheses: sort(items, (('name', False, False),))
AttributeError: 'dict' object has no attribute 'name'
Sort key uses getattr, but items are dictionaries; attribute access fails.
fix
Convert dicts to objects (e.g., using types.SimpleNamespace) or sort using Python's sorted() with a lambda.
Upgrade
Version history
6.0latest on PyPI · released Sep 12, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
44 hits · last 30 days
node
36
OpenAI (training)
1
Resources
zope-sequencesort — pip install zope-sequencesort · libregistry