Skip to main content

FuzzyDict, an ambiguous dictionary

Project description

fuzzydict, an ambiguous dictionary

>>> from fuzzydict import FuzzyDict
>>> fdict = FuzzyDict(0.5) # setting a threshold range from 0.0 to 1.0
>>> # < Assign some values to the 'fdict'>
>>> fdict
>>> {'0123456789': 0, 'X123456789': 1, 'XX23456789': 2, 'XXX3456789': 3, 'XXXX456789': 4, 'XXXXX56789': 5, 'XXXXXX6789': 6, 'XXXXXXX789': 7, 'XXXXXXXX89':8, 'XXXXXXXXX9':9, 'XXXXXXXXXX': 10}
>>> [key for key in fdict.fuzzy_keys('0123456789')]
['0123456789', 'X123456789', 'XX23456789', 'XXX3456789', 'XXXX456789', 'XXXXX56789']
>>> [value for value in fdict.fuzzy_values('0123456789')]
[0, 1, 2, 3, 4, 5]
>>> fdict.fuzzy_add('0123456789', 1) # bulk add
>>> [(k, v) for (k, v) in fdict.fuzzy_items('0123456789')]
[('0123456789', 1), ('X123456789', 2), ('XX23456789', 3), ('XXX3456789', 4), ('XXXX456789', 5), ('XXXXX56789', 6)]
>>> fdict['0123456789'] # You can also access a FuzzyDict as a normal dict
1

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

fuzzydict-0.0.1.tar.gz (2.5 kB view details)

Uploaded Source

File details

Details for the file fuzzydict-0.0.1.tar.gz.

File metadata

  • Download URL: fuzzydict-0.0.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fuzzydict-0.0.1.tar.gz
Algorithm Hash digest
SHA256 59c04c61a69de49d125f9d73a635f7db3eec33601ee6ababddd756aa873c0be3
MD5 1df433b4385ce5577098b6685ac9e232
BLAKE2b-256 3c1cdc9bcd355c9d036833aaae91f6b9193610b28ade43e32d4fbd3bbfaf1e17

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page