--- id: bbhash version: "0.6.0" license: unclear license_treatment: unclear maintenance: aging --- # bbhash — A Python wrapper for the BBHash Minimal Perfect Hash Function License: unclear · Maintenance: aging · Downloads: 87.7K/mo ## What it is and what it does pybbhash is a Cython wrapper around the BBHash C++ library for constructing minimal perfect hash functions optimized for 64-bit hash values. It provides two main interfaces: PyMPHF for building and querying a minimal perfect hash function, and BBHashTable for associating arbitrary values with hashes and retrieving them later. The package is designed primarily for bioinformatics workflows involving k-mer hashing, where you need to map large collections of hash values to compact integer identifiers or associated metadata. The core use case is storing and querying relationships between hashes generated by tools like khmer or sourmash—for example, mapping k-mer hashes to De Bruijn graph node IDs. BBHashTable extends the basic MPHF by supporting lookups on hashes that were not part of the original construction, returning None for missing keys. Both modules support save/load to disk for persistence. Use it for: - Map k-mer hashes to De Bruijn graph node identifiers in genome assembly workflows. - Store and retrieve compact metadata associated with large collections of 64-bit hashes without full hash table overhead. - Build minimal perfect hash functions for read deduplication or abundance tracking in sequencing pipelines. - Query pre-built MPHF structures loaded from disk to avoid reconstruction overhead in repeated analyses. - Associate arbitrary values with hashes in memory-constrained bioinformatics environments where space efficiency matters. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Builds minimal perfect hash functions for 64-bit hashes using BBHash, with optional value-table storage for hash-to-value lookups. Yes, with conditions. Install if you need minimal perfect hash functions for 64-bit hashes in a bioinformatics or k-mer-heavy workflow and can tolerate Cython compilation. The package is actively maintained and has no known vulnerabilities, but verify the unclear license status before use in proprietary contexts. High install friction and Python >=3.11 requirement may limit adoption in legacy environments. ## Install pip install bbhash uv add bbhash poetry add bbhash ## Installing bbhash Before you install: High install friction due to Cython compilation requirement. Package is aging (292 days since last release) but repository remains active with a recent commit on 2025-10-26. Requires Python >=3.11. License in practice: License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license before use in proprietary or restricted contexts. Quickstart: import bbhash uint_hashes = [10, 20, 50, 80] mph = bbhash.PyMPHF(uint_hashes, len(uint_hashes), 1, 1.0) for val in uint_hashes: print('{} hashes to {}'.format(val, mph.lookup(val))) Requires Cython compilation during install (high friction). Python >=3.11 required. Depends on numpy. Verify before relying: - Thread safety of PyMPHF and BBHashTable is noted as needing investigation by the maintainer. - Whether the package is suitable for production use in bioinformatics pipelines beyond the original spacegraphcats use case. - Performance characteristics and memory overhead compared to alternative hash table implementations. ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: high - Maintenance: aging - Downloads: 87.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags minimal perfect hash function, 64-bit hash lookup, bbhash python wrapper, hash table with values, k-mer hashing, perfect hash mphf, hash function construction, bioinformatics, hash-function, cython [View on SkillFed](https://skillfed.io/packages/bbhash) · [View on PyPI](https://pypi.org/project/bbhash/)