Skip to main content

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.
  • 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)

Source distribution for minimindslab-key-value-sort 0.1.0
File Size Uploaded Provenance
minimindslab_key_value_sort-0.1.0.tar.gz 3.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for minimindslab-key-value-sort 0.1.0
File Interpreter ABI Platform
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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page