Dict with fuzzy key matching
Project description
Dict with fuzzy key matching
pip install fuzzyydictyy
Tested against Windows 10 / Python 3.10 / Anaconda
Approximate Key Lookups:
The fuzzy matching capability allows users to retrieve values even if the exact key is not available. This can be beneficial when dealing with user input, search queries, or data with potential typos or variations.
Data Normalization:
By allowing fuzzy matching, FuzzDict can help normalize input keys to a standard form. For example, if you have keys like "JohnDoe," "john_doe," and "John-Doe," you can use FuzzDict to map them to a standardized key, such as "johndoe," ensuring consistent access to the associated values.
Data Deduplication:
When working with large datasets, fuzzy key matching can assist in identifying and handling duplicate keys with slight variations. Instead of creating multiple keys for similar values, you can consolidate them under a single key, reducing redundancy and improving data organization.
Improved User Experience:
With fuzzy matching, FuzzDict can enhance user experience by accommodating user errors or variations in input. It can provide suggestions or automatically retrieve the closest matching value, reducing frustration and increasing usability.
Time Efficiency:
By leveraging the rapidfuzz library, FuzzDict performs efficient fuzzy matching algorithms, enabling quick lookup of values based on approximate keys. This can be especially advantageous when dealing with large datasets or real-time applications that require fast responses.
from fuzzyydictyy import FuzzDict, dict_config
from rapidfuzz import fuzz
dict_config.fuzzycfg = {
'scorer': fuzz.WRatio,
}
d = FuzzDict()
d["hans"] = 3
d["bobo"] = 30
d["baba"] = 320
print(d['hjan']) # Output: 3 (Exact match for 'hjan' is not found)
print(d['boba']) # Output: 30 (Exact match for 'boba' is not found)
print(d['babaa']) # Output: 320 (Exact match for 'babaa' is not found)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fuzzyydictyy-0.12.tar.gz
.
File metadata
- Download URL: fuzzyydictyy-0.12.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4ebcaede42101a98db22fc4fa49b1ea29d5130c7b9b516d4d460948a65391fc |
|
MD5 | f4ca690c691434513d64fc9c662ca0f5 |
|
BLAKE2b-256 | 1760ae64435391a4827e0578793de4dea1a252a04f565e0ce42377341f2f472e |
File details
Details for the file fuzzyydictyy-0.12-py3-none-any.whl
.
File metadata
- Download URL: fuzzyydictyy-0.12-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fba5509a0e4bc6eb8997051f6c5c884d8a3a2c4937c1353db033bf3652da4867 |
|
MD5 | 6f7d82f4435d7c7912a454710bac1f77 |
|
BLAKE2b-256 | fd53e7986840fcd93dddc93e27c0bde6e82d9a5ec5c24b6d52d043d2b050f55a |