Metadata-Version: 2.0
Name: simple-fuzzysearch
Version: 0.0.4
Summary: Matching a string with partial input
Home-page: https://github.com/ferhatelmas/simple-fuzzysearch
Author: Ferhat Elmas
Author-email: elmas.ferhat@gmail.com
License: MIT
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities

===========
fuzzysearch
===========

Tiny and blazing-fast fuzzy search in Python.

Fuzzy searching allows for flexibly matching a string with partial input, useful for filtering data very quickly based on lightweight user input.

Port of `fuzzysearch in JavaScript <https://github.com/bevacqua/fuzzysearch>`_ into Python.

Install
-------

Just install using pip::

    $ pip install simple-fuzzysearch

fuzzysearch(needle, haystack)
-----------------------------

Returns true if needle matches haystack using a fuzzy-searching algorithm.
Note that this program doesn't implement levenshtein distance, but rather a simplified version where there's no approximation.
The method will return true only if each character in the needle can be found in the haystack and occurs after the preceding matches.

.. code-block:: python

    fuzzysearch('twl', 'cartwheel') # <- true
    fuzzysearch('cart', 'cartwheel') # <- true
    fuzzysearch('cw', 'cartwheel') # <- true
    fuzzysearch('ee', 'cartwheel') # <- true
    fuzzysearch('art', 'cartwheel') # <- true
    fuzzysearch('eeel', 'cartwheel') # <- false
    fuzzysearch('dog', 'cartwheel') #  <- false

License
-------

MIT



