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.
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)
Reporting bugs
Please see BUG_REPORTS.
Contribute
Please see CONTRIBUTING.
Licence
Please see LICENSE.
Project details
Release history Release notifications | RSS feed
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 hashes)