MiniMindsLab Key-Value Sort
Deterministically sort flat key-value mappings by key, with optional case-insensitive ordering and stable output for reproducible config/text generation.
Why
When generating config files, fixtures, or canonical text, stable ordering makes diffs and hashes reliable.
Installation
This project is a pure Python library with no runtime dependencies.
Usage
from minimindslab_key_value_sort import sort_key_value_items, sort_key_value_dict
data = {"b": 2, "A": 1, "a": 3}
items = sort_key_value_items(data)
# [('A', 1), ('a', 3), ('b', 2)]
items_ci = sort_key_value_items(data, case_insensitive=True)
# [('A', 1), ('a', 3), ('b', 2)]
ordered_dict = sort_key_value_dict(data, case_insensitive=True)
# {'A': 1, 'a': 3, 'b': 2}
API
sort_key_value_items(mapping, case_insensitive=False)- Returns a list of
(key, value)tuples sorted deterministically.
- Returns a list of
sort_key_value_dict(mapping, case_insensitive=False)- Returns a new dict with insertion order matching deterministic sorted order.
Notes
- Input must be a mapping (
collections.abc.Mapping). - Keys must be strings.
- In case-insensitive mode, ordering is by
key.lower()with a stable tie-breaker by original key.
License
MIT
Metadata
Release files for minimindslab-key-value-sort 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| minimindslab_key_value_sort-0.1.0.tar.gz | 3.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| minimindslab_key_value_sort-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.4 kB
Release files / minimindslab_key_value_sort-0.1.0.tar.gz
| Download URL | minimindslab_key_value_sort-0.1.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c0bfb642638d4042d8bdb6e3e28bf5900d2b9f7923171b54c0eaad4e4013f9b
|
|
BLAKE2b-256 checksum How to use checksums |
fe2601134a8ed881848245488dad9f2ca849492491976dcc112663b5539155dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
n8n
|
Release files / minimindslab_key_value_sort-0.1.0-py3-none-any.whl
| Download URL | minimindslab_key_value_sort-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6c923ce1d41ae1dbe0da524de8a6074c3db403ce3004ee917ee58f0980a2bed4
|
|
BLAKE2b-256 checksum How to use checksums |
c170f5840751d814353537394bf3b9f7390c562d29f625f0a26c2a174b6b7579
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
n8n
|
Security for minimindslab-key-value-sort 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.