This topic describes how to install and use Tablestore SDK for Python.

Prerequisites

Download Tablestore SDK for Python

  • Download the package of Tablestore SDK for python. For more information, see SDK package.
  • Download Tablestore SDK for Python from GitHub. For more information, visit GitHub.

For more information about the versions of Tablestore SDK for Python, see Tablestore SDK for Python.

Compatibility

  • Tablestore SDK for Python V5.x.x: compatible. Tablestore SDK for Python V5.2.1 is incompatible with Tablestore SDK for Python V5.1.0 in the following conditions:
    • The type of the result returned by the Search operation is different between the two versions.

      By default, Tablestore SDK for Python V5.1.0 and earlier return results of the Tuple type. By default, Tablestore SDK for Python V5.2.0 and later returns SearchResponse objects for Search requests. SearchResponse supports the __iter__ method to traverse data. You can use the SearchResponse.v1_response() method to return results of the Tuple type.

    • The ParallelScan operation is added.

      By default, the results returned for ParallelScan requests are ParallelScanResponse objects. You can use the SearchResponse.v1_response() method to return results of the Tuple type.

  • Tablestore SDK for Python V4.x.x: compatible.
  • Tablestore SDK for Python V2.x.x: incompatible. Tablestore SDK for Python V2.x.x supports primary key columns in random order, which are no longer supported in Tablestore SDK for Python V4.0.0 and later. Tablestore SDK for Python V4.x.x and Tablestore SDK for Python V2.x.x are incompatible in the following respects:
    • The package name is changed from ots2 to tablestore.
    • The TableOptions parameter is added for the Client.create_table operation.
    • The type of the primary_key parameter is changed from dict to list for the put_row, get_row, and update_row operations to ensure the sequence of primary keys.
    • The type of the attribute_columns parameter is changed from dict to list for the put_row and update_row operations.
    • The timestamp parameter is added to the attribute_columns parameter for the put_row and update_row operations.
    • The max_version and time_range parameters are added for the get_row and get_range operations. You must specify at least one of max_version and time_range.
    • The return_type parameter is added for the put_row, update_row, and delete_row operations. Only RT_PK is supported to return the primary key value of the current row.
    • The return_row parameter is added for the put_row, update_row, and delete_row operations. If you set return_type to RT_PK in the request, the primary key value of the row is returned in return_row.

Version

Latest version: 5.2.1.