Value scoring and best match picking.
Project description
Installing
pip3 install explore
Specific Usage
import explore
# yummy foods to choose from
foods = ('pasta', 'pork', 'broccoli', 'anchovy', 'peking duck')
# choosing during a keyboard stroke
food = explore.pick(foods, 'vorcloki')
Generic Usage
import explore
# lots of yummy food info
foods = food_api.get_all()
# match according to these attributes
fetch = lambda food: (food.id, food.name)
# returns value, NOT attribute matched against
food = explore.pick(foods, 'vorcloki', fetch = fetch)
Extended Usage
import explore
# lots of yummy food info
foods = food_api.get_all()
# match according to these attributes
fetch = lambda food: (food.id, food.name, food.color)
# this is a generator, iterating exhausts it
pairs = explore.generic(fetch, values, 'vorcloki') # [(food, score), ...]
# best matching one
food = explore.lead(pairs)
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
explore-0.0.0.tar.gz
(2.2 kB
view hashes)