Skip to main content

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/

Metadata

Release files for batch-table-storage 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for batch-table-storage 0.0.9
File Size Uploaded
batch_table_storage-0.0.9.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for batch-table-storage 0.0.9
File Interpreter ABI Platform
batch_table_storage-0.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / batch_table_storage-0.0.9.tar.gz

Download URL batch_table_storage-0.0.9.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
edf10768eccbf2a93f7a46026b805b66943f42cfecc612c546ec08a0a7528562
BLAKE2b-256 checksum
How to use checksums
8d7eb50487c9b20df1cf56357ce6c81521efc11f0084048cf1605d8e1313b3a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0

Release files / batch_table_storage-0.0.9-py3-none-any.whl

Download URL batch_table_storage-0.0.9-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d6806657666443877cad7133c648f451a3d5e2f97d0896c460889e6dc5b0684
BLAKE2b-256 checksum
How to use checksums
bae1c803c1fad41f6d7185c00cba60820b9d21ba35c828bf3832c21003ead605
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0

Release history Release notifications | RSS feed

This release

0.0.9 This release

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page