From 26f285640f58ecdc19ebf4c864f7a761ef942c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=9A=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BB=D1=91=D0=B2?= Date: Thu, 15 Sep 2016 18:22:02 +0400 Subject: [PATCH] "items" function for key-value pairs selection Added "items" function to enable key-value pairs selection. --- jmespath/functions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jmespath/functions.py b/jmespath/functions.py index a7c7bd9e..423879cb 100644 --- a/jmespath/functions.py +++ b/jmespath/functions.py @@ -287,6 +287,10 @@ def _func_keys(self, arg): def _func_values(self, arg): return list(arg.values()) + @signature({"types": ['object']}) + def _func_items(self, arg): + return list(map(list, arg.items())) + @signature({'types': []}) def _func_type(self, arg): if isinstance(arg, STRING_TYPE):