Skip to main content

MiniMindsLab JSON Number Normalize

Normalize number-like values in parsed JSON-style Python data for stable comparisons and snapshots.

What it does

  • Recursively processes nested dict, list, and tuple structures.
  • Normalizes numeric Python values (int, float) deterministically.
  • Leaves strings unchanged by default (including numeric strings like "01").
  • Returns a new structure and does not mutate the input.

API

from minimindslab_json_number_normalize import normalize_numbers

result = normalize_numbers(data, whole_floats_to_int=True)

Parameters

  • data: JSON-like parsed Python structure.
  • whole_floats_to_int (default True): converts floats like 1.0 to 1.
  • normalize_numeric_strings (default False): if enabled, attempts to parse numeric-looking strings into numbers.

Example

from minimindslab_json_number_normalize import normalize_numbers

payload = {
    "a": 1.0,
    "b": [2.0, "01", {"c": 3.5}],
}

print(normalize_numbers(payload))
# {'a': 1, 'b': [2, '01', {'c': 3.5}]}

Testing

python -m unittest discover -s tests -p "test*.py"

Metadata

Release files for minimindslab-json-number-normalize 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-json-number-normalize 0.1.0
File Size Uploaded Provenance
minimindslab_json_number_normalize-0.1.0.tar.gz 3.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for minimindslab-json-number-normalize 0.1.0
File Interpreter ABI Platform
minimindslab_json_number_normalize-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.3 kB

Release files / minimindslab_json_number_normalize-0.1.0.tar.gz

Download URL minimindslab_json_number_normalize-0.1.0.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
705d62e7474a017d951bae27bff205b853da26845ae36fff7b44f2aec1df88d5
BLAKE2b-256 checksum
How to use checksums
a1d573e8d0aed51c0f8bc32dd006b6b2d0019875d12bc82f30409a92e5c03f6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via n8n

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

Download URL minimindslab_json_number_normalize-0.1.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b036e3c166e425b2238d5d997dc741c446593092055a987f0ee7667c07b243b9
BLAKE2b-256 checksum
How to use checksums
f51f579362ea4d375f01b696c1dc2be1ac70aa67eae88965883b01bdc296ab48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via n8n

Security for minimindslab-json-number-normalize 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