Skip to content

Add a key / mapping parameter for extract/extractOne in process #81

Description

@micostabal

I don't know if this already exists hereor somewhere else, but it would be cool If the extract methods could have an extra optional, None by default key parameter, just like the sorted function in python.

Imagine being able to extract most similar elements based on attributes or methods of an object for example:

`
class Sth:
a: str
b: int

def __init__(self, _a, _b):
    self.a=_a
    self.b=_b

process.extractOne(Sth('hi', 1), [Sth('bye', 2), Sth('hi!', 3)], key=lambda x: x.a)
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions