Skip to main content

Parses Aurora responses into a list dictionaries with column names as keys

Project description

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:

[
  {"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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aurora-prettyparser-1.0.4.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

aurora_prettyparser-1.0.4-py2.py3-none-any.whl (6.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file aurora-prettyparser-1.0.4.tar.gz.

File metadata

  • Download URL: aurora-prettyparser-1.0.4.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.7.9

File hashes

Hashes for aurora-prettyparser-1.0.4.tar.gz
Algorithm Hash digest
SHA256 6f99b06d7ebf145a2f0f969510223bea848b7cc01d024898919f1dc84f0a7f03
MD5 52f682880ef533fc4851159a2ad27b97
BLAKE2b-256 f85174a0b2d30ebd7493704ab86630837602396715f6961610521ec864aad2f7

See more details on using hashes here.

File details

Details for the file aurora_prettyparser-1.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: aurora_prettyparser-1.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.7.9

File hashes

Hashes for aurora_prettyparser-1.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d914e593b87aa1142f296fcb92e422d2ac22904a46a1fcd9c6ee7897a3190883
MD5 d01e5f1461d64b2115b1eb0b983c7096
BLAKE2b-256 3c88c7ba4bd9d7e88d43b65b170f0e0f788af642dcda57e59533f7fe035b1da5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page