Skip to main content

Get element by fuzzy key from dict

Project description

Build Status

Dict extension - get_fuzzy

Get element by fuzzy key from dict.

Introduction

The library is extension for buildin type dict. After import you can use get_fuzzy and get_fuzzy_stats like get method.

The minimum required python-3.4

Installing

This library can be install from pip:

pip install dict-extend-fuzzy

Usage

Simple example

from dictextendfuzzy import get_fuzzy

data = {
	'aaaa' : 1,
	'bbbb' : 2
}

data.get_fuzzy('aaab')  # 1

Get some more information

from dictextendfuzzy import get_fuzzy_stats

data = {
	'aaaa' : 1,
	'bbbb' : 2
}

obj = data.get_fuzzy_stats('aaab')
obj.key     # 'aaaa'
obj.value   # 1
obj.ratio   # 0.75

With optional parameters

data.get_fuzzy('kei', 'default_object', level=0.5)
data.get_fuzzy_stats('kay', {}, level=0.25)

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

dict-extend-fuzzy-0.2.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dict_extend_fuzzy-0.2.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file dict-extend-fuzzy-0.2.2.tar.gz.

File metadata

  • Download URL: dict-extend-fuzzy-0.2.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for dict-extend-fuzzy-0.2.2.tar.gz
Algorithm Hash digest
SHA256 dc4f8fcefab9642753369f00d35c169d6b1aebb612eacba74547902999431c6a
MD5 0f57a1d8da8f0b6e05254d00a6fbaceb
BLAKE2b-256 5ec05ccf54abf032eef48a35114e88f4b905b681ad99cc6750b737500d83babd

See more details on using hashes here.

File details

Details for the file dict_extend_fuzzy-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: dict_extend_fuzzy-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for dict_extend_fuzzy-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c85738f781833aef4353f5b97350e85e6da8871bfd4e19f41f488199da7cf45a
MD5 ada6f944f8495c98b5414bd0fd9707bf
BLAKE2b-256 dc5f2ecf30745adf8707da69a7d5c8eda731bb045379f132831cea9513ace477

See more details on using hashes here.

Supported by

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