diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-15 03:47:26 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-15 03:47:26 +0000 |
commit | 457bb79b7f56f5f01205626c8e9349c87f93fa4d (patch) | |
tree | b8491102e511020d10270b33e6301ad8bcfdb4d9 | |
parent | 34040776b274f7103599f8a967ae6bcb3684b9e8 (diff) |
automatic import of python-pfzy
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-pfzy.spec | 314 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 316 insertions, 0 deletions
@@ -0,0 +1 @@ +/pfzy-0.3.4.tar.gz diff --git a/python-pfzy.spec b/python-pfzy.spec new file mode 100644 index 0000000..8f15ab4 --- /dev/null +++ b/python-pfzy.spec @@ -0,0 +1,314 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pfzy +Version: 0.3.4 +Release: 1 +Summary: Python port of the fzy fuzzy string matching algorithm +License: MIT +URL: https://github.com/kazhala/pfzy +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/d9/5a/32b50c077c86bfccc7bed4881c5a2b823518f5450a30e639db5d3711952e/pfzy-0.3.4.tar.gz +BuildArch: noarch + +Requires: python3-Sphinx +Requires: python3-furo +Requires: python3-myst-parser +Requires: python3-sphinx-autobuild +Requires: python3-sphinx-copybutton + +%description +# pfzy + +[](https://github.com/kazhala/pfzy/actions?query=workflow%3ACI) +[](https://readthedocs.org/projects/pfzy/) +[](https://ap-southeast-2.console.aws.amazon.com/codesuite/codebuild/378756445655/projects/pfzy/history?region=ap-southeast-2&builds-meta=eyJmIjp7InRleHQiOiIifSwicyI6e30sIm4iOjIwLCJpIjowfQ) +[](https://coveralls.io/github/kazhala/pfzy?branch=master) +[](https://pypi.org/project/pfzy/) +[](https://pypi.org/project/pfzy/) +[](https://github.com/kazhala/pfzy/blob/master/LICENSE) + +<!-- start elevator-pitch-intro --> + +Python port of the [fzy](https://github.com/jhawthorn/fzy) fuzzy string matching algorithm. + +- [Async fuzzy match function](https://pfzy.readthedocs.io/en/latest/pages/usage.html#matcher) +- [Fzy scorer (fuzzy string match)](https://pfzy.readthedocs.io/en/latest/pages/usage.html#fzy-scorer) +- [Substring scorer (exact substring match)](https://pfzy.readthedocs.io/en/latest/pages/usage.html#substr-scorer) + +## Requirements + +``` +python >= 3.7 +``` + +## Installation + +```sh +pip install pfzy +``` + +## Quick Start + +**Full documentation: [https://pfzy.readthedocs.io/](https://pfzy.readthedocs.io/)** + +```python +import asyncio + +from pfzy import fuzzy_match + +result = asyncio.run(fuzzy_match("ab", ["acb", "acbabc"])) +``` + +``` +>>> print(result) +[{'value': 'acbabc', 'indices': [3, 4]}, {'value': 'acb', 'indices': [0, 2]}] +``` + +<!-- end elevator-pitch-intro --> + +## Background + +[fuzzywuzzy](https://github.com/seatgeek/fuzzywuzzy) is a famous python package for performing fuzzy matching +between strings powered by [python-Levenshtein](https://github.com/miohtama/python-Levenshtein). While it does its +job well it doesn't calculate/provide the matching indices which is essential in a fuzzy finder applications. + +The [fzy](https://github.com/jhawthorn/fzy) fuzzy matching algorithm can calculate the matching score while also +providing the matching indices which fuzzy finder applications can use to provide extra highlights. + +The initial implementation of this algorithm can be found at [sweep.py](https://github.com/aslpavel/sweep.py) which +is a python implementation of the terminal fuzzy finder. The code snippet is later used by the project [vim-clap](https://github.com/liuchengxu/vim-clap). + +**I found myself needing this logic across multiple projects hence decided to strip out the logic and publish a dedicated +package with detailed documentation and unittest.** + +<!-- start elevator-pitch-ending --> + +## Credit + +- [fzy](https://github.com/jhawthorn/fzy) +- [sweep.py](https://github.com/aslpavel/sweep.py) +- [vim-clap](https://github.com/liuchengxu/vim-clap) + +## LICENSE + +> All 3 projects mentioned in [Credit](#credit) are all licensed under [MIT](https://opensource.org/licenses/MIT). + +This project is licensed under [MIT](https://github.com/kazhala/pfzy). Copyright (c) 2021 Kevin Zhuang + +<!-- end elevator-pitch-ending --> + + +%package -n python3-pfzy +Summary: Python port of the fzy fuzzy string matching algorithm +Provides: python-pfzy +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pfzy +# pfzy + +[](https://github.com/kazhala/pfzy/actions?query=workflow%3ACI) +[](https://readthedocs.org/projects/pfzy/) +[](https://ap-southeast-2.console.aws.amazon.com/codesuite/codebuild/378756445655/projects/pfzy/history?region=ap-southeast-2&builds-meta=eyJmIjp7InRleHQiOiIifSwicyI6e30sIm4iOjIwLCJpIjowfQ) +[](https://coveralls.io/github/kazhala/pfzy?branch=master) +[](https://pypi.org/project/pfzy/) +[](https://pypi.org/project/pfzy/) +[](https://github.com/kazhala/pfzy/blob/master/LICENSE) + +<!-- start elevator-pitch-intro --> + +Python port of the [fzy](https://github.com/jhawthorn/fzy) fuzzy string matching algorithm. + +- [Async fuzzy match function](https://pfzy.readthedocs.io/en/latest/pages/usage.html#matcher) +- [Fzy scorer (fuzzy string match)](https://pfzy.readthedocs.io/en/latest/pages/usage.html#fzy-scorer) +- [Substring scorer (exact substring match)](https://pfzy.readthedocs.io/en/latest/pages/usage.html#substr-scorer) + +## Requirements + +``` +python >= 3.7 +``` + +## Installation + +```sh +pip install pfzy +``` + +## Quick Start + +**Full documentation: [https://pfzy.readthedocs.io/](https://pfzy.readthedocs.io/)** + +```python +import asyncio + +from pfzy import fuzzy_match + +result = asyncio.run(fuzzy_match("ab", ["acb", "acbabc"])) +``` + +``` +>>> print(result) +[{'value': 'acbabc', 'indices': [3, 4]}, {'value': 'acb', 'indices': [0, 2]}] +``` + +<!-- end elevator-pitch-intro --> + +## Background + +[fuzzywuzzy](https://github.com/seatgeek/fuzzywuzzy) is a famous python package for performing fuzzy matching +between strings powered by [python-Levenshtein](https://github.com/miohtama/python-Levenshtein). While it does its +job well it doesn't calculate/provide the matching indices which is essential in a fuzzy finder applications. + +The [fzy](https://github.com/jhawthorn/fzy) fuzzy matching algorithm can calculate the matching score while also +providing the matching indices which fuzzy finder applications can use to provide extra highlights. + +The initial implementation of this algorithm can be found at [sweep.py](https://github.com/aslpavel/sweep.py) which +is a python implementation of the terminal fuzzy finder. The code snippet is later used by the project [vim-clap](https://github.com/liuchengxu/vim-clap). + +**I found myself needing this logic across multiple projects hence decided to strip out the logic and publish a dedicated +package with detailed documentation and unittest.** + +<!-- start elevator-pitch-ending --> + +## Credit + +- [fzy](https://github.com/jhawthorn/fzy) +- [sweep.py](https://github.com/aslpavel/sweep.py) +- [vim-clap](https://github.com/liuchengxu/vim-clap) + +## LICENSE + +> All 3 projects mentioned in [Credit](#credit) are all licensed under [MIT](https://opensource.org/licenses/MIT). + +This project is licensed under [MIT](https://github.com/kazhala/pfzy). Copyright (c) 2021 Kevin Zhuang + +<!-- end elevator-pitch-ending --> + + +%package help +Summary: Development documents and examples for pfzy +Provides: python3-pfzy-doc +%description help +# pfzy + +[](https://github.com/kazhala/pfzy/actions?query=workflow%3ACI) +[](https://readthedocs.org/projects/pfzy/) +[](https://ap-southeast-2.console.aws.amazon.com/codesuite/codebuild/378756445655/projects/pfzy/history?region=ap-southeast-2&builds-meta=eyJmIjp7InRleHQiOiIifSwicyI6e30sIm4iOjIwLCJpIjowfQ) +[](https://coveralls.io/github/kazhala/pfzy?branch=master) +[](https://pypi.org/project/pfzy/) +[](https://pypi.org/project/pfzy/) +[](https://github.com/kazhala/pfzy/blob/master/LICENSE) + +<!-- start elevator-pitch-intro --> + +Python port of the [fzy](https://github.com/jhawthorn/fzy) fuzzy string matching algorithm. + +- [Async fuzzy match function](https://pfzy.readthedocs.io/en/latest/pages/usage.html#matcher) +- [Fzy scorer (fuzzy string match)](https://pfzy.readthedocs.io/en/latest/pages/usage.html#fzy-scorer) +- [Substring scorer (exact substring match)](https://pfzy.readthedocs.io/en/latest/pages/usage.html#substr-scorer) + +## Requirements + +``` +python >= 3.7 +``` + +## Installation + +```sh +pip install pfzy +``` + +## Quick Start + +**Full documentation: [https://pfzy.readthedocs.io/](https://pfzy.readthedocs.io/)** + +```python +import asyncio + +from pfzy import fuzzy_match + +result = asyncio.run(fuzzy_match("ab", ["acb", "acbabc"])) +``` + +``` +>>> print(result) +[{'value': 'acbabc', 'indices': [3, 4]}, {'value': 'acb', 'indices': [0, 2]}] +``` + +<!-- end elevator-pitch-intro --> + +## Background + +[fuzzywuzzy](https://github.com/seatgeek/fuzzywuzzy) is a famous python package for performing fuzzy matching +between strings powered by [python-Levenshtein](https://github.com/miohtama/python-Levenshtein). While it does its +job well it doesn't calculate/provide the matching indices which is essential in a fuzzy finder applications. + +The [fzy](https://github.com/jhawthorn/fzy) fuzzy matching algorithm can calculate the matching score while also +providing the matching indices which fuzzy finder applications can use to provide extra highlights. + +The initial implementation of this algorithm can be found at [sweep.py](https://github.com/aslpavel/sweep.py) which +is a python implementation of the terminal fuzzy finder. The code snippet is later used by the project [vim-clap](https://github.com/liuchengxu/vim-clap). + +**I found myself needing this logic across multiple projects hence decided to strip out the logic and publish a dedicated +package with detailed documentation and unittest.** + +<!-- start elevator-pitch-ending --> + +## Credit + +- [fzy](https://github.com/jhawthorn/fzy) +- [sweep.py](https://github.com/aslpavel/sweep.py) +- [vim-clap](https://github.com/liuchengxu/vim-clap) + +## LICENSE + +> All 3 projects mentioned in [Credit](#credit) are all licensed under [MIT](https://opensource.org/licenses/MIT). + +This project is licensed under [MIT](https://github.com/kazhala/pfzy). Copyright (c) 2021 Kevin Zhuang + +<!-- end elevator-pitch-ending --> + + +%prep +%autosetup -n pfzy-0.3.4 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-pfzy -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 0.3.4-1 +- Package Spec generated @@ -0,0 +1 @@ +fe5314b42eae239bbe47c013243a2175 pfzy-0.3.4.tar.gz |