Parses Aurora responses into a list dictionaries with column names as keys
Project description
Parses aurora serverless API responses into a more usable format. Results are returned as a list of dictionaries with the column names being the key. Nulls (returned by Aurora as isNull) are returned as None types. Any value that can be parsed as json is cast from a string to a list/dictionary. Responses are returned formated as:
[
{"columnOneName": "value", "columnTwoName": "value"},
{"columnOneName": "value", "columnTwoName": "value"}
]
Where each item in the top level array is a separate row.
Methods
parseResults(records) -> list Arguments: records – The records from the API query (execute_statement()[“records”])
Example
from auroraPrettyParser import parseResults
response = client.execute_statement(
secretArn=environ["PG_SECRET"],
database=environ["DB_NAME"],
parameters=parameters,
resourceArn=environ["DB_ARN"],
includeResultMetadata=True,
sql=sql
)
print(parseResults(response))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for aurora-prettyparser-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e83fc1f47d4fc43e9d8e6fc250d38892c513a0360be505bda602c72d6fc48295 |
|
MD5 | 3203f58c8e13187cfdc51c8f5792a09a |
|
BLAKE2b-256 | 0706f8af98b85cf74fc4ae613733866b26f1fb4a02248ceb81a557ff3cfb62cd |
Close
Hashes for aurora_prettyparser-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 041c7d07f6f5dba97ae7255685fc95d67a49d1a43522121e2e5952d306034fec |
|
MD5 | debd650a915153f2e82597462aeb948f |
|
BLAKE2b-256 | 9aa67b8b3d0d90c84c9186bbea5b5047f81004306bcd1317515ded0b99ae94c0 |