Async batch functionality for Azure Table Storage
Project description
Async Microsoft Azure CosmosDB Table SDK for Python with batching functionality
This project provides a asynchronous wrapper for the Azure cosmosdb TableService.
The wrapper lets you insert/merge/replace/delete lists of entities using aioify
.
You can give it any number of PartitionKeys, they will be processed in different batches.
For documentation on the base package please see azure-cosmosdb-table
package. (https://pypi.org/project/azure-cosmosdb-table/)
Features
- Automatically split lists of entities into batches based on PartitionKey
- Automatically chunk entities into sub-lists for correct batch sizes
- Batch Insert Entities async
- Batch Update Entities async
- Batch Merge Entities async
- Batch Delete Entities async
- Batch Insert or Replace Entities async
- Batch Insert or Merge Entities async
Getting Started
To install via the Python Package Index (PyPI), type:
pip install batch-table-storage
Minimum Requirements
- azure-cosmosdb-table==1.0.6
Code Sample
Import the wrapper class
from batch_table_service import BatchTableService
Instantiate the service
service = BatchTableService(account_name='storageAccount', account_key='x')
Create some entities
entities = [
{'PartitionKey': 'person', 'RowKey': '1', 'name': 'John'},
{'PartitionKey': 'pet', 'RowKey': '1', 'name': 'Cat'}
]
Import asyncio:
import asyncio
Create and commit the batches async:
asyncio.run(
service.batch_insert_entities(table_name='tableA', entities=entities)
)
Learn More
Microsoft Azure CosmosDB Table SDK for Python: https://pypi.org/project/azure-cosmosdb-table/
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for batch_table_storage-0.0.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8839a523c0877d3a7f9d80f4512630e87033a685a32cb9671c79695b87e83fb5 |
|
MD5 | 055cc5769a6ef4fa4343038c85c19fb1 |
|
BLAKE2b-256 | 254e70e9ccbafb5b726daf2e506ab08277f886ca326a9626755fffd74470f402 |
Hashes for batch_table_storage-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04f9bb088dea57990a34d117c790b262f48d84fd7d16b4f9a91b750f8d7580df |
|
MD5 | 373e064d591db893cabed39a832b9983 |
|
BLAKE2b-256 | 311a056dddeda9fec0feb85273ad394d517691ba2cb47d9c35fad243b8c5a66e |