Batch functionality for Azure Table Storage
Project description
Microsoft Azure CosmosDB Table SDK for Python with batching functionality
This project provides a wrapper for the Azure cosmosdb TableService. The wrapper lets you insert/merge/replace lists of entities. 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
- Batch Update Entities
- Batch Merge Entities
- Batch Delete Entities
- Batch Insert or Replace Entities
- Batch Insert or Merge Entities
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'}
]
Create and commit the batches:
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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 747d04db88ba02c7a8a611aeb445ad197c6075f2f0a8c5bccb3b24f7ced124b2 |
|
MD5 | f0f5e957bd995b16cf2b7ec4d399febb |
|
BLAKE2b-256 | 3fd6095e0920132a261ac0d982f9040c0f4239aa915ee43fba6b349e39885a26 |
Hashes for batch_table_storage-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e10bb16275679c8a8ed4d300692f2fae477e49c2b4ec9ccca16fae64497bf26 |
|
MD5 | c58dbd10edb6b9a32833fa5e95d5ea12 |
|
BLAKE2b-256 | b372d51e3726371c7db4a3a9e359b840443fd58dcb7c46ff8b0a1385fcdc96c0 |