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.

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.2.0.tar.gz (74.5 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for cmph-cffi-0.2.0.tar.gz
Algorithm Hash digest
SHA256 53f8adb6b1d960771797223ed84370e81dc1904dfb5c7093ec7873a17df70b8d
MD5 b76b1021086cf1b17ac1b2c269fcd63c
BLAKE2b-256 5ca2efc6c0d10586cb203a32d5fa6afe0321620e8881c34e106b7950cc67589c

See more details on using hashes here.

Supported by

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