MySQL Connector/Python Developer Guide

10.2.43 MySQLConnection.converter-class Property

This property sets and returns the converter class to use when configuring the connection.

# get the current converter class being used
print(cnx.converter_class)
>> <class 'mysql.connector.conversion.MySQLConverter'>

class TestConverter(MySQLConverterBase): ...

# set the custom converter class
cnx.converter_class = TestConverter
print(cnx.converter_class)
>> <class '__main__.TestConverter'>