{"id":16896689,"url":"https://github.com/jettify/uddsketch-py","last_synced_at":"2025-07-29T06:05:14.382Z","repository":{"id":37970639,"uuid":"456322475","full_name":"jettify/uddsketch-py","owner":"jettify","description":"uddsketch data structure for fast and accurate tracking of quantiles in data stream.","archived":false,"fork":false,"pushed_at":"2023-07-01T21:05:11.000Z","size":68,"stargazers_count":5,"open_issues_count":9,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-18T02:04:47.906Z","etag":null,"topics":["ddsketch","quantile","uddsketch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jettify.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-07T01:38:46.000Z","updated_at":"2023-10-10T12:32:57.000Z","dependencies_parsed_at":"2025-02-19T13:38:05.054Z","dependency_job_id":"963c614d-804f-4538-9f5a-95831e14a3f3","html_url":"https://github.com/jettify/uddsketch-py","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jettify/uddsketch-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jettify%2Fuddsketch-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jettify%2Fuddsketch-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jettify%2Fuddsketch-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jettify%2Fuddsketch-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jettify","download_url":"https://codeload.github.com/jettify/uddsketch-py/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jettify%2Fuddsketch-py/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267638818,"owners_count":24119764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ddsketch","quantile","uddsketch"],"created_at":"2024-10-13T17:32:43.369Z","updated_at":"2025-07-29T06:05:14.342Z","avatar_url":"https://github.com/jettify.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"uddsketch\n=============\n.. image:: https://github.com/jettify/uddsketch-py/workflows/CI/badge.svg\n   :target: https://github.com/jettify/uddsketch-py/actions?query=workflow%3ACI\n   :alt: GitHub Actions status for master branch\n.. image:: https://codecov.io/gh/jettify/uddsketch-py/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/jettify/uddsketch-py\n.. image:: https://img.shields.io/pypi/pyversions/uddsketch.svg\n    :target: https://pypi.org/project/uddsketch\n.. image:: https://img.shields.io/pypi/v/uddsketch.svg\n    :target: https://pypi.python.org/pypi/uddsketch\n..\n.. image:: https://readthedocs.org/projects/uddsketch/badge/?version=latest\n    :target: https://uddsketch.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n\n**uddsketch** data structure for fast and accurate tracking of quantiles in\ndata streams. Implantation is based on ideas described in  DDSketch_ and\nUDDSketch_ papers.\n\n\nSimple example\n--------------\n\n.. code:: python\n\n    from uddsketch import UDDSketch\n\n    hist = UDDSketch(initial_error=0.01)\n\n    # Populate structure with dummy data\n    for i in range(0, 100):\n        hist.add(0.1 * i)\n\n    # Estimate p95 percentile\n    q = hist.quantile(0.95)\n    print(f\"quantie: {q}\")\n    # quantie: 9.487973051696695\n\n    # Estimate median\n    m = hist.median()\n    print(f\"median: {m}\")\n    # median: 4.903763642930295\n\n\nMerging Two Sketches\n--------------------\n\n.. code:: python\n\n    import numpy as np\n\n    from uddsketch import UDDSketch\n\n\n    def main():\n        # fix seed for reproducible results\n        rs = np.random.RandomState(seed=42)\n        # generate dummy data\n        data = ((rs.pareto(3.0, 5000) + 1) * 2.0).tolist()\n\n        # add first half to first sketch\n        hist1 = UDDSketch(initial_error=0.01, max_buckets=128)\n        for v in data[:500]:\n            hist1.add(v)\n\n        # add second half to other sketch\n        hist2 = UDDSketch(initial_error=0.01, max_buckets=128)\n        for v in data[500:]:\n            hist2.add(v)\n\n        hist1.merge(hist2)\n        combined_count = hist1.num_values\n        print(f\"Num values added to combined sketch: {combined_count}\")\n        # Num values added to combined sketch: 5000\n\n        # Estimate combined p95 percentile\n        q = hist1.quantile(0.95)\n        print(f\"quantie: {q}\")\n        # quantie: 5.419515033387234\n\n        # Estimate combined median\n        m = hist1.median()\n        print(f\"median: {m}\")\n        # median: 2.5344610207788048\n\n\n    if __name__ == \"__main__\":\n        main()\n\n\nInstallation\n------------\nInstallation process is simple, just::\n\n    $ pip install uddsketch\n\n\nReferences\n----------\n\n1. Charles Masson, Jee E. Rim and Homin K. Lee. *DDSketch: a fast and fully-mergeable quantile sketch\nwith relative-error guarantees.* [https://www.vldb.org/pvldb/vol12/p2195-masson.pdf]\n\n2. I. Epicoco, C. Melle, M. Cafaro, M. Pulimeno and G. Morleo. *UDDSketch: Accurate Tracking of\nQuantiles in Data Streams.* [https://arxiv.org/abs/2004.08604]\n\n\n.. _DDSketch: https://www.vldb.org/pvldb/vol12/p2195-masson.pdf\n.. _UDDSketch: https://arxiv.org/abs/2004.08604\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjettify%2Fuddsketch-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjettify%2Fuddsketch-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjettify%2Fuddsketch-py/lists"}