datalad / datalad-gooey

A graphical user interface for DataLad (datalad.org)
https://docs.datalad.org/projects/gooey
Other
4 stars 6 forks source link

Constraint: `EnsureMapping(key=Constraint, value=Constraint, delimiter=':')` #292

Closed mih closed 1 year ago

mih commented 1 year ago

For parameter specification as proposed here, it would be useful to have constraint for a mapping to cover a wide range input scenarios.

The input could be any 2-tuple, 2-element-list, one-item-dict. It could even be str that is .split(sep=delimiter, maxsplit=1) to get a 2-element-list.

Once key and value of the mapping have been determined, there will each be passed to their respective constraints.