Matching/Filtering Utilities - durian.match — durian v0.0.1 documentation

### Navigation

- index
- modules |
- next |
- previous |
- durian v0.0.1 documentation »
- Module API Reference »

# Matching/Filtering Utilities - durian.match

`durian.match.` `mtuplelist_to_matchdict`(mtuplelist)

  Converts a list of `(name, kind, what)` tuples to a match dict. Where name is the field to match, kind is a matchable number mapping to `CONST_TO_MATCHABLE`.

  Possible types are: `CONDITION_EXACT`, `CONDITION_STARTSWITH`,
    `CONDITION_ENDSWITH, ``CONDITION_CONTAINS`.

  Probably best explained by an example:

      >>> mtuplelist = [("name", CONDITION_ENDSWITH, "Constanza"),
      ...               ("zipcode", CONDITION_STARTSWITH, "70")]
      >>> mtuplelist_to_matchdict(mtuplelist)
      {"name": Endswith("Constanza"), "zipcode": Startswith("70")}

### Navigation

- index
- modules |
- next |
- previous |
- durian v0.0.1 documentation »
- Module API Reference »