{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/22"},{"label":"Information Analysis","url":"https://skillfed.io/packages/category/scientific-engineering-information-analysis/4"},{"label":"Linguistic","url":"https://skillfed.io/packages/category/text-processing-linguistic/3"}],"enrichment":{"capability":"Madoka implements a Count-Min sketch data structure for memory-efficient counting of string-int pairs in streaming data, with lower memory overhead than Python dict or Counter.","skillfed_tags":["probabilistic-data-structures","streaming-algorithms","memory-efficient"],"use_cases":["Approximate word frequency counting in large text streams where memory is constrained.","Real-time traffic or event counting where exact counts are less important than memory efficiency.","Merging frequency counts from multiple data sources with minimal memory overhead.","Extracting top-K most frequent items from a stream without storing all unique items.","Comparing similarity between two frequency distributions using inner product."],"what_it_does":"Madoka is a Python wrapper around a C++ Count-Min sketch library that trades exact counting for memory efficiency. It provides multiple classes (Sketch, CroquisFloat, CroquisDouble, CroquisUint8/16/32/64) to store different numeric types, each using a probabilistic data structure that approximates frequencies with bounded error. Unlike a standard Python dict or Counter, a sketch uses fixed memory regardless of the number of unique keys, making it suitable for streaming scenarios where you cannot store all keys in memory.\n\nThe package supports typical counter operations\u2014increment, add, set, get\u2014plus sketch-specific operations like merge, shrink, inner product, and median. It can serialize to disk, load from file, and extract top-K most common keys if initialized with a k parameter. The tradeoff is that you cannot enumerate all keys (only top-K), and values are approximate rather than exact.","worth_installing":"Yes, if you need memory-efficient approximate counting for streaming data and can tolerate ~0.0911% error. The package is stable (Alpha status, 12+ years old), has no known vulnerabilities, and supports modern Python versions. Install friction is moderate due to compiled wheels. Not suitable if you require exact counts or need to enumerate all keys."},"id":"madoka","links":{"html":"https://skillfed.io/packages/madoka","md":"https://skillfed.io/packages/madoka.md","pypi":"https://pypi.org/project/madoka/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2025-11-30","license_spdx":null,"license_treatment":"permissive","name":"madoka","python_support":"unspecified","summary":"Memory-efficient CountMin Sketch key-value structure (based on Madoka C++ library)"},"popularity":{"monthly_downloads":79120,"position":14379,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.7.2.1"}
