fuzzy string matching
Project description
fuzstr
Developer Guide
Setup
# create conda environment
$ mamba env create -f env.yml
# update conda environment
$ mamba env update -n fuzstr --file env.yml
Install
pip install -e .
# install from pypi
pip install fuzstr
nbdev
# activate conda environment
$ conda activate fuzstr
# make sure the fuzstr package is installed in development mode
$ pip install -e .
# make changes under nbs/ directory
# ...
# compile to have changes apply to the fuzstr package
$ nbdev_prepare
Publishing
# publish to pypi
$ nbdev_pypi
# publish to conda
$ nbdev_conda --build_args '-c conda-forge'
$ nbdev_conda --mambabuild --build_args '-c conda-forge -c dsm-72'
Usage
Installation
Install latest from the GitHub repository:
$ pip install git+https://github.com/dsm-72/fuzstr.git
or from conda
$ conda install -c dsm-72 fuzstr
or from pypi
$ pip install fuzstr
Documentation
Documentation can be found hosted on GitHub repository pages. Additionally you can find package manager specific guidelines on conda and pypi respectively.
fuzstr
apple = fuzstr('Apple', icase=False, ispace=False, iunder=False, cutoff=1)
grape = fuzstr('Grape', icase=True, ispace=True, iunder=True, cutoff=1)
mango = fuzstr('Mango')
for fruit in (apple, grape, mango):
rstr = fruit.raw.lower()
print(
f'{fruit}:',
fruit == fuzstr(rstr), fruit == fruit.makesame(rstr),
fruit == fruit.makesame(rstr), fruit == fuzstr(rstr),
)
Apple: False False False False
Grape: True True True True
Mango: True True True True
apple.prep(apple), apple.prep(mango), mango.prep(apple), mango.prep(mango), issubclass(type(mango), fuzstr)
('Apple', 'Mango', 'apple', 'mango', True)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fuzstr-0.0.8.tar.gz
(10.3 kB
view details)
Built Distribution
File details
Details for the file fuzstr-0.0.8.tar.gz
.
File metadata
- Download URL: fuzstr-0.0.8.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae7afd8bbda003d9f5ffba264b983d4feb8610f6138fa0159616a4804089edb5 |
|
MD5 | ff9f2a263cf1a17d676e8aa88d04e469 |
|
BLAKE2b-256 | 2095025702a755ea496bf9ac764f4b7292c9f48b32e349934b9854f636b06460 |
File details
Details for the file fuzstr-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: fuzstr-0.0.8-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 177e45d83191f2725b461cc06118645a65d1110a8dc897dda8b140f239c486a0 |
|
MD5 | 5928a0429580b641fb9daf93d9a58789 |
|
BLAKE2b-256 | 77d7a478d704904df96a4918c6d1e0afb59a5bd1fbef7e7cd40234fa139a18b4 |