Python Driver: Types

This page gives an overview how values are converted between Polypheny and Python. For more information of the Polypheny Types check this page.

Polypheny to Python

Polypheny Python Notes
BIGINT int  
BOOLEAN bool  
DATE datetime.date  
DECIMAL int or float Python type depends on if DECIMAL is a whole number or not.
DOUBLE float  
INTEGER int  
REAL float  
SMALLINT int  
TEXT str  
TIME datetime.time  
TIMESTAMP datetime.datetime When converting a TIMESTAMP to datetime.datetime the timezone is always set to UTC.
TINYINT int  
VARCHAR str  
AUDIO, FILE, IMAGE, VIDEO bytes  

Special types

Special Type Python Type Notes
Arrays list  
Documents dict  

Intervals

In Polypheny intervals consist of two values: Months and milliseconds. Values of this type are returned as instances of the polypheny.interval.IntervalMonthMilliseconds class.

Note: Intervals cannot be used as dynamic parameter in queries.

Python to Polypheny

The following types can be serialized by the Python driver:

bool, bytes, datetime.date, datetime.datetime, datetime.time, float, int, list and str.

© Polypheny GmbH. All Rights Reserved.