Debian Codegraph @

fuzzywuzzy.egg-info/PKG-INFO

raw
1 Metadata-Version: 2.1
2 Name: fuzzywuzzy
3 Version: 0.18.0
4 Summary: Fuzzy string matching in python
5 Home-page: https://github.com/seatgeek/fuzzywuzzy
6 Author: Adam Cohen
7 Author-email: [email protected]
8 License: GPLv2
9 Description: .. image:: https://travis-ci.org/seatgeek/fuzzywuzzy.svg?branch=master
10 :target: https://travis-ci.org/seatgeek/fuzzywuzzy
11
12 FuzzyWuzzy
13 ==========
14
15 Fuzzy string matching like a boss. It uses `Levenshtein Distance <https://en.wikipedia.org/wiki/Levenshtein_distance>`_ to calculate the differences between sequences in a simple-to-use package.
16
17 Requirements
18 ============
19
20 - Python 2.7 or higher
21 - difflib
22 - `python-Levenshtein <https://github.com/ztane/python-Levenshtein/>`_ (optional, provides a 4-10x speedup in String
23 Matching, though may result in `differing results for certain cases <https://github.com/seatgeek/fuzzywuzzy/issues/128>`_)
24
25 For testing
26 ~~~~~~~~~~~
27 - pycodestyle
28 - hypothesis
29 - pytest
30
31 Installation
32 ============
33
34 Using PIP via PyPI
35
36 .. code:: bash
37
38 pip install fuzzywuzzy
39
40 or the following to install `python-Levenshtein` too
41
42 .. code:: bash
43
44 pip install fuzzywuzzy[speedup]
45
46
47 Using PIP via Github
48
49 .. code:: bash
50
51 pip install git+git://github.com/seatgeek/[email protected]#egg=fuzzywuzzy
52
53 Adding to your ``requirements.txt`` file (run ``pip install -r requirements.txt`` afterwards)
54
55 .. code:: bash
56
57 git+ssh://[email protected]/seatgeek/[email protected]#egg=fuzzywuzzy
58
59 Manually via GIT
60
61 .. code:: bash
62
63 git clone git://github.com/seatgeek/fuzzywuzzy.git fuzzywuzzy
64 cd fuzzywuzzy
65 python setup.py install
66
67
68 Usage
69 =====
70
71 .. code:: python
72
73 >>> from fuzzywuzzy import fuzz
74 >>> from fuzzywuzzy import process
75
76 Simple Ratio
77 ~~~~~~~~~~~~
78
79 .. code:: python
80
81 >>> fuzz.ratio("this is a test", "this is a test!")
82 97
83
84 Partial Ratio
85 ~~~~~~~~~~~~~
86
87 .. code:: python
88
89 >>> fuzz.partial_ratio("this is a test", "this is a test!")
90 100
91
92 Token Sort Ratio
93 ~~~~~~~~~~~~~~~~
94
95 .. code:: python
96
97 >>> fuzz.ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear")
98 91
99 >>> fuzz.token_sort_ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear")
100 100
101
102 Token Set Ratio
103 ~~~~~~~~~~~~~~~
104
105 .. code:: python
106
107 >>> fuzz.token_sort_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear")
108 84
109 >>> fuzz.token_set_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear")
110 100
111
112 Process
113 ~~~~~~~
114
115 .. code:: python
116
117 >>> choices = ["Atlanta Falcons", "New York Jets", "New York Giants", "Dallas Cowboys"]
118 >>> process.extract("new york jets", choices, limit=2)
119 [('New York Jets', 100), ('New York Giants', 78)]
120 >>> process.extractOne("cowboys", choices)
121 ("Dallas Cowboys", 90)
122
123 You can also pass additional parameters to ``extractOne`` method to make it use a specific scorer. A typical use case is to match file paths:
124
125 .. code:: python
126
127 >>> process.extractOne("System of a down - Hypnotize - Heroin", songs)
128 ('/music/library/good/System of a Down/2005 - Hypnotize/01 - Attack.mp3', 86)
129 >>> process.extractOne("System of a down - Hypnotize - Heroin", songs, scorer=fuzz.token_sort_ratio)
130 ("/music/library/good/System of a Down/2005 - Hypnotize/10 - She's Like Heroin.mp3", 61)
131
132 .. |Build Status| image:: https://api.travis-ci.org/seatgeek/fuzzywuzzy.png?branch=master
133 :target: https:travis-ci.org/seatgeek/fuzzywuzzy
134
135 Known Ports
136 ============
137
138 FuzzyWuzzy is being ported to other languages too! Here are a few ports we know about:
139
140 - Java: `xpresso's fuzzywuzzy implementation <https://github.com/WantedTechnologies/xpresso/wiki/Approximate-string-comparison-and-pattern-matching-in-Java>`_
141 - Java: `fuzzywuzzy (java port) <https://github.com/xdrop/fuzzywuzzy>`_
142 - Rust: `fuzzyrusty (Rust port) <https://github.com/logannc/fuzzyrusty>`_
143 - JavaScript: `fuzzball.js (JavaScript port) <https://github.com/nol13/fuzzball.js>`_
144 - C++: `Tmplt/fuzzywuzzy <https://github.com/Tmplt/fuzzywuzzy>`_
145 - C#: `fuzzysharp (.Net port) <https://github.com/BoomTownRoi/BoomTown.FuzzySharp>`_
146 - Go: `go-fuzzywuzz (Go port) <https://github.com/paul-mannino/go-fuzzywuzzy>`_
147 - Free Pascal: `FuzzyWuzzy.pas (Free Pascal port) <https://github.com/DavidMoraisFerreira/FuzzyWuzzy.pas>`_
148 - Kotlin multiplatform: `FuzzyWuzzy-Kotlin <https://github.com/willowtreeapps/fuzzywuzzy-kotlin>`_
149 - R: `fuzzywuzzyR (R port) <https://github.com/mlampros/fuzzywuzzyR>`_
150
151 Platform: UNKNOWN
152 Classifier: Intended Audience :: Developers
153 Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
154 Classifier: Programming Language :: Python
155 Classifier: Programming Language :: Python :: 2.7
156 Classifier: Programming Language :: Python :: 3
157 Classifier: Programming Language :: Python :: 3.4
158 Classifier: Programming Language :: Python :: 3.5
159 Classifier: Programming Language :: Python :: 3.6
160 Provides-Extra: speedup