Skip to content

Helper functions to convert types returned from Athena into Python types

License

Notifications You must be signed in to change notification settings

QuiNovas/athena-type-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

athena-type-converter

A libary of convertors for AWS Athena results. This greatly simplifies handling of results returned from boto3 get_query_results calls.

Installation

pip install athena-type-converter

Usage

This will convert all the contained ResultSet into a list of dict's, where the dictionary keys are the column names, and the values are converted to Python value equivalents.

from athena_type_converter import convert_result_set
from boto3 import client

athena = client('athena')
query_execution_id = athena.start_query_execution(...)
response = athena.get_query_results(
  QueryExecutionId=query_execution_id
)
results = convert_result_set(response['ResultSet']

More sophisticated usage is exposed, including the complete list of type converters by AWS Athena type names.

License: APL2

About

Helper functions to convert types returned from Athena into Python types

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages