Metadata-Version: 2.1
Name: aurora-prettyparser
Version: 1.0.0
Summary: Parses Aurora responses into a list dictionaries with column names as keys
Home-page: https://github.com/QuiNovas/aurora-prettyparser
Author: Mathew Moon
Author-email: mmoon@quinovas.com
License: Apache 2.0
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/x-rst

============================
aurora_response_parser
============================

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:

.. code-block:: JSON

  [
    {"columnOneName": "value", "columnTwoName": "value"},
    {"columnOneName": "value", "columnTwoName": "value"}
  ]

Where each item in the top level array is a separate row.

Usage
----------------------------

parseResults(records)

### Args:
## records
The records from the API query (execute_statement()["records"])

## metadata
The column metadata from API query (execute_statement()["columnMetadata"])

Example
----------------------------

.. code-block:: python

  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)


