GithubHelp home page GithubHelp logo

venkateshks / cmph-cffi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pombredanne/cmph-cffi

0.0 2.0 0.0 1.21 MB

Python Binding for cmph

License: GNU Lesser General Public License v2.1

CMake 0.18% Shell 0.29% Python 8.46% C 88.62% Objective-C 0.83% C++ 1.62%

cmph-cffi's Introduction

CFFI bindings to the CMPH library

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')

Warning

Be aware that whilst MPH's are awesome, they typically cannot distinguish between keys they are built on and unseen keys. Concretely this means that feeding in keys that are not in the original key set will have undefined results

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.

cmph-cffi's People

Contributors

gregbowyer avatar venkateshks avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.