from azure.data.tables import TableEntity entity = TableEntity(partition_key='pk001', row_key='rk001') entity.name = 'John Doe' entity.age = 35
from azure.data.tables import TableServiceClient table_service_client = TableServiceClient.from_connection_string(connection_string='your_connection_string_here', table_name='your_table_name_here') query_filter = "PartitionKey eq 'pk001' and age gt 30" query_results = table_service_client.query_entities(filter=query_filter) for entity in query_results: print(entity.name, entity.age)
from azure.data.tables import BatchOperation, TableEntity batch = BatchOperation() entity1 = TableEntity(partition_key='pk001', row_key='rk001') entity1.name = 'John Doe' entity1.age = 35 entity2 = TableEntity(partition_key='pk001', row_key='rk002') entity2.name = 'Jane Doe' entity2.age = 28 batch.create_entity(entity1) batch.create_entity(entity2) table_service_client.submit_batch(batch=batch)In summary, the azure.data.tables package library enables Python developers to interact with Azure Table Storage through the use of the TableEntity class. This class is used to represent entities in a table and can be used for querying, inserting, updating, and deleting records.