semvec/pypi-packages huggingface dataset:
dynamodb-prettyparser 1.0.4
Parses dynamodb responses into a list dictionaries with attribute names as keys
License: Apache 2.0

============================
Dynamodb Pretty Parser
============================

=======================================================================
THIS PACKAGE IS NOW PART OF the appsync-tools package Use it instead   
=======================================================================
https://github.com/QuiNovas/appsync-tools


Parses Dynamodb responses into a more usable format. Results are returned as a list of dictionaries with the attribute names being the key. Results are parsed recursively.
One use is to return results directly to Appsync from a Lambda function.
Parses all scalar types that Dynamo supports

* N (number scalar) - cast as integer or Decimal types
* S (string scalar) - stays string
* SS (string set scalar) - list of strings
* NS (number set scalar) - list of Decimal/integer
* L (list scalar) - list
* BOOL (boolean scalar) - boolean
* B (binary scalar) - string of base64
* BS (binary set scalar) - list of base64 strings
* NULL (null scalar) - None
* M (map scalar) - Dictionary


Responses are returned formated as:

.. code-block:: JSON

  [
    {"attributeOneName": {"S": "value1"}, "attributeTwoName": {"S": "value2"}},
    {"attributeOneName": {"S": "value1"}, "attributeTwoName": {"S": "value2"}}
  ]

Becomes

.. code-block:: JSON

  [
    {"attributeOneName": "value1", "attributeTwoName": "value2"},
    {"attributeOneName": "value1", "attributeTwoName": "value2"}
  ]

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

Methods
----------------------------

parseResults(records) -> dict
Arguments:
items -- Response from any boto3 call to Dynamodb that returns Items in the response

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

.. code-block:: python

  from dynamodbPrettyParser import parseResults
  import boto3

  dynamodb = boto3.client('dynamodb')
  response = dynamodb.query(
    TableName='mytable',
    KeyConditionExpression='my_attribute = :foo',
    ExpressionAttributeValues={':foo': 'bar'}
  )

  print(parseResults(response))
aurora-prettyparser 1.0.4
Parses Aurora responses into a list dictionaries with column names as keys
License: Apache 2.0

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

=======================================================================
THIS PACKAGE IS NOW PART OF the appsync-tools package Use it instead
=======================================================================
https://github.com/QuiNovas/appsync-tools


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.

Methods
----------------------------

parseResults(records) -> list
Arguments:
records -- The records from the API query (execute_statement()["records"])

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))