Skip to main content

MiniMindsLab URL Query Sort

Deterministically parse, normalize, and re-serialize URL query strings with stable key ordering and optional value sorting.

Features

  • Stable query key ordering.
  • Deterministic handling of repeated keys.
  • Consistent normalization of:
    • empty keys
    • blank values
    • missing = segments
  • Percent-encoding-safe round trip using UTF-8.
  • Pure Python (standard library only), offline-friendly.

Install

This package is standard Python packaging with src/ layout.

Usage

from minimindslab_url_query_sort import normalize_query, parse_query

q = "b=2&a=3&a=1&flag&=x&empty="

pairs = parse_query(q)
# [('b', '2'), ('a', '3'), ('a', '1'), ('flag', ''), ('', 'x'), ('empty', '')]

normalized = normalize_query(q, sort_values_for_repeated_keys=True)
# '=x&a=1&a=3&b=2&empty=&flag='

API

  • parse_query(query: str) -> list[tuple[str, str]]
  • normalize_pairs(pairs: list[tuple[str, str]], *, sort_values_for_repeated_keys: bool = False) -> str
  • normalize_query(query: str, *, sort_values_for_repeated_keys: bool = False) -> str

Ordering policy

  • Keys are sorted lexicographically.
  • For repeated keys:
    • default: preserve original relative order (stable)
    • optional: sort values lexicographically when sort_values_for_repeated_keys=True

Normalization policy

  • Missing = becomes blank value (e.g., flag -> flag=).
  • Blank values are serialized with = (e.g., x=).
  • Empty keys are allowed (e.g., =v).

Metadata

Release files for minimindslab-url-query-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-url-query-sort 0.1.0
File Size Uploaded Provenance
minimindslab_url_query_sort-0.1.0.tar.gz 3.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for minimindslab-url-query-sort 0.1.0
File Interpreter ABI Platform
minimindslab_url_query_sort-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / minimindslab_url_query_sort-0.1.0.tar.gz

Download URL minimindslab_url_query_sort-0.1.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
451dc9349c6f7e6042ea9325a9f527d9bc418fc1f954cfc36bfcdd956c516491
BLAKE2b-256 checksum
How to use checksums
f6b2da8d732c1b82e8daa59e5f35077eae32a5557abea2a30976204e0b057d43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via n8n

Release files / minimindslab_url_query_sort-0.1.0-py3-none-any.whl

Download URL minimindslab_url_query_sort-0.1.0-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70ff4b6fba9569f10ff2f391e7cbdd8cd6478b3e273e051dc474a7b71436cda9
BLAKE2b-256 checksum
How to use checksums
1ac6732287394182bcd626e311eaf085432b112a9c9227ff6137e31660b9296d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via n8n

Security for minimindslab-url-query-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