Skip to main content

uri-cardinality-reducer

The purpose of this module is to provide a callable function that takes a typical URI with parameters and high-cardinality data and returns a transformed URI resembling a the URI template with all high-cardinality data removed. Reducing the cardinality of the real URI to basic URI template with placeholders allows that data to be used in clustering exercises, GROUP BY expressions, and similar analytical purposes that rely on groupings.

Installation

pip install uri_cardinality_reducer

Example usage:

`from uri_cardinality_reducer import UriCardinalityReducer reducer = UriCardinalityReducer(include_query=True)

high_cardinality_uri = "https://example.com/users/550e8400-e29b-41d4-a716-446655440000/profile" reduced_cardinality_uri = reducer.extract(high_cardinality_uri) print(reduced_cardinality_uri)`

The output should be: https://example.com/users/<UUID>/profile

Additional examples:

Original URI URI masked template
https://example.com/users/bobjones/posts/789 https://example.com/users/<USER>/posts/<NUM>
https://api.example.com/v1/orders/2024-01-15/items/42 https://api.example.com/v<<NUM>>/orders/<USER>/items/<NUM>
https://example.com/users/550e8400-e29b-41d4-a716-446655440000/profile https://example.com/users/<UUID>/profile

Metadata

Release files for uri-cardinality-reducer 0.2.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 uri-cardinality-reducer 0.2.0
File Size Uploaded Provenance Actions
uri_cardinality_reducer-0.2.0.tar.gz 6.1 kB With provenance Details for uri_cardinality_reducer-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for uri-cardinality-reducer 0.2.0
File Interpreter ABI Platform Actions
uri_cardinality_reducer-0.2.0-py3-none-any.whl Python 3 none any Details for uri_cardinality_reducer-0.2.0-py3-none-any.whl

Total release size: 12.3 kB

Release files / uri_cardinality_reducer-0.2.0.tar.gz

Download URL uri_cardinality_reducer-0.2.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
83da5e240fec89815796bce6d078656233b24e01c80f87ca2330eb68ea7bca86
BLAKE2b-256 checksum
How to use checksums
3b922ec36308281e3f037f67101ad09067cd5e0b6ffc7d448a9eca2cf7045142
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / uri_cardinality_reducer-0.2.0-py3-none-any.whl

Download URL uri_cardinality_reducer-0.2.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5da0d93298cd7a45901609b893d3c562c07185b88c47facdc1e73dbecbb842d0
BLAKE2b-256 checksum
How to use checksums
acc32c7f619761548d77dea3ca1dbb1e18fd0818477b04f9b566353e95531e1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for uri-cardinality-reducer 0.2.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for uri_cardinality_reducer-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

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.2.0 This release

2 release files Full 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