Presto Types Parser

0.0.2 · active · verified Fri Apr 17

`presto-types-parser` is a small Python library designed to parse and convert input rows returned by the Presto REST API according to their specified Presto data types. It ensures that data structures like arrays, maps, and rows, as well as primitive types, are correctly interpreted into Python equivalents. The current version is 0.0.2, and it appears to have a very slow release cadence with only one public release.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates how to parse a list of Presto-style rows using a corresponding list of Presto type strings. The function converts the raw input into native Python types based on the schema.

from presto_types_parser import parse_presto_rows

rows = [[1, 'value_a', True], [2, 'value_b', False], [3, None, True]]
types = ['INTEGER', 'VARCHAR', 'BOOLEAN']

parsed_data = parse_presto_rows(rows, types)
print(parsed_data)
# Expected output:
# [[1, 'value_a', True], [2, 'value_b', False], [3, None, True]]

view raw JSON →