from datetime import datetime


def python_type_to_sql_type(_python_type):
    """
    Convert a python data type to ab SQL type.

    :param _python_type: A Python internal type
    """
    if _python_type == str:
        return 'string'
    elif _python_type == bytes:
        return "blob"
    elif _python_type == float:
        return "float"
    elif _python_type == int:
        return "integer"
    elif _python_type == datetime:
        return "datetime"
    elif _python_type == bool:
        return "boolean"
    else:
        raise Exception("python_type_to_sql_type: _type_code \"" + str(_python_type) + "\"not supported")