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)
Metadata
Release files for fuzzyydictyy 0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fuzzyydictyy-0.12.tar.gz | 4.0 kB | Without provenance | Details for fuzzyydictyy-0.12.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fuzzyydictyy-0.12-py3-none-any.whl | Python 3 | none | any | Details for fuzzyydictyy-0.12-py3-none-any.whl |
Total release size: 9.7 kB
Release files / fuzzyydictyy-0.12.tar.gz
| Download URL | fuzzyydictyy-0.12.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4ebcaede42101a98db22fc4fa49b1ea29d5130c7b9b516d4d460948a65391fc
|
|
BLAKE2b-256 checksum How to use checksums |
1760ae64435391a4827e0578793de4dea1a252a04f565e0ce42377341f2f472e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Release files / fuzzyydictyy-0.12-py3-none-any.whl
| Download URL | fuzzyydictyy-0.12-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fba5509a0e4bc6eb8997051f6c5c884d8a3a2c4937c1353db033bf3652da4867
|
|
BLAKE2b-256 checksum How to use checksums |
fd53e7986840fcd93dddc93e27c0bde6e82d9a5ec5c24b6d52d043d2b050f55a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Security for fuzzyydictyy 0.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.