Skip to main content

CFFI enabled bindings to the CMPH library forcreating and using minimal perfect hashes

Project description

These bindings provide python with the ability to create and use Minimal Perfect Hashes via the CMPH library.


Latest version released on PyPi Build status Coverage Code Health


Installation

Should be as simple as

$ pip install cmph-cffi

Development version

The latest development version can be installed directly from GitHub:

$ pip install --upgrade 'git+https://github.com/URXtech/cmph-cffi'

Usage

Creating a new MPH

import cmph
with open('/usr/share/dict/words', 'w') as keys:
    mph = cmph.generate_hash(keys)

Getting keys out of an MPH

mph('Test')

Saving the MPH

with open('/tmp/out.mph', 'w') as out_file:
    mph.save(out_file)

Loading a pre-existing MPH

with open('/tmp/out.mph') as in_file:
    cmph.load_hash(in_file)

Authors

Greg Bowyer (@GregBowyer) and Venkatesh Sharma (@Venkateshks) created these bindings and these fine people did all the hard implementation work in CMPH.

Reporting bugs

Please see BUG_REPORTS.

Contribute

Please see CONTRIBUTING.

Licence

Please see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cmph-cffi-0.3.0.tar.gz (82.7 kB view details)

Uploaded Source

File details

Details for the file cmph-cffi-0.3.0.tar.gz.

File metadata

  • Download URL: cmph-cffi-0.3.0.tar.gz
  • Upload date:
  • Size: 82.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cmph-cffi-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0ee85742ed27e17686d8016c210a88c2e638b34e3a8bccbaf348df00419bdccb
MD5 70d8295ba9b081cfdfce4b28193c6349
BLAKE2b-256 96af2f0f7709d6d0b57ca8db49afca8e7d1cf1463627d889720a8651e5da2796

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page