JMESPath Functions
Built-in JMESPath Functions to easily deserialize common encoded JSON payloads in Lambda functions.
Usage Documentation
| FUNCTION | DESCRIPTION | 
|---|---|
| extract_data_from_envelope | Searches and extracts data using JMESPath | 
| query | Searches and extracts data using JMESPath | 
extract_data_from_envelope ¶
extract_data_from_envelope(
    data: dict | str,
    envelope: str,
    jmespath_options: dict | None = None,
) -> Any
Searches and extracts data using JMESPath
Deprecated: Use query instead
Source code in aws_lambda_powertools/utilities/jmespath_utils/__init__.py
              | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |  | 
query ¶
query(
    data: dict | str,
    envelope: str,
    jmespath_options: dict | None = None,
) -> Any
Searches and extracts data using JMESPath
Envelope being the JMESPath expression to extract the data you're after
Built-in JMESPath functions include: powertools_json, powertools_base64, powertools_base64_gzip
Example
Deserialize JSON string and extracts data from body key
| 1 2 3 4 5 6 7 8 9 |  | 
| PARAMETER | DESCRIPTION | 
|---|---|
| data | Data set to be filtered | 
| envelope | JMESPath expression to filter data against 
                  
                    TYPE:
                       | 
| jmespath_options | Alternative JMESPath options to be included when filtering expr 
                  
                    TYPE:
                       | 
| RETURNS | DESCRIPTION | 
|---|---|
| Any | Data found using JMESPath expression given in envelope | 
Source code in aws_lambda_powertools/utilities/jmespath_utils/__init__.py
              | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |  |