Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ferhatelmas/simple-fuzzysearch
Fast and simple fuzzy search in Python
https://github.com/ferhatelmas/simple-fuzzysearch
Last synced: 26 days ago
JSON representation
Fast and simple fuzzy search in Python
- Host: GitHub
- URL: https://github.com/ferhatelmas/simple-fuzzysearch
- Owner: ferhatelmas
- License: mit
- Created: 2015-03-11T10:10:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-03-11T11:31:37.000Z (over 9 years ago)
- Last Synced: 2024-10-07T09:49:02.964Z (about 1 month ago)
- Language: Python
- Homepage: https://pypi.python.org/pypi/simple-fuzzysearch
- Size: 127 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.txt
- License: LICENSE.txt
Awesome Lists containing this project
README
===========
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 `_ 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
from fuzzysearch import fuzzysearch
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') # <- falseLicense
-------MIT