Skip to main content

srx-lib-azure

Lightweight wrappers over Azure SDKs used across SRX services.

What it includes:

  • Blob: upload/download helpers, SAS URL generation
  • Email (Azure Communication Services): simple async sender
  • Table: simple CRUD helpers
  • Document Intelligence (OCR): document analysis from URLs or bytes

Install

PyPI (public):

  • pip install srx-lib-azure

uv (pyproject):

[project]
dependencies = ["srx-lib-azure>=0.1.0"]

Usage

Blob:

from srx_lib_azure.blob import AzureBlobService
blob = AzureBlobService()
url = await blob.upload_file(upload_file, "documents/report.pdf")

Email:

from srx_lib_azure.email import EmailService
svc = EmailService()
await svc.send_notification("user@example.com", "Subject", "Hello", html=False)

Table:

from srx_lib_azure.table import AzureTableService
store = AzureTableService()
store.ensure_table("events")
store.upsert_entity("events", {"PartitionKey":"p","RowKey":"r","EventType":"x"})

Document Intelligence (OCR):

from srx_lib_azure import AzureDocumentIntelligenceService

# Initialize with endpoint and key
doc_service = AzureDocumentIntelligenceService(
    endpoint="https://your-resource.cognitiveservices.azure.com/",
    key="your-api-key"
)

# Analyze document from URL
result = await doc_service.analyze_document_from_url(
    url="https://example.com/document.pdf",
    model_id="prebuilt-read"  # or "prebuilt-layout", "prebuilt-invoice", etc.
)

# Analyze document from bytes
with open("document.pdf", "rb") as f:
    content = f.read()
result = await doc_service.analyze_document_from_bytes(
    file_content=content,
    model_id="prebuilt-read"
)

# Result structure:
# {
#     "success": True/False,
#     "content": "extracted text...",
#     "pages": [{"page_number": 1, "width": 8.5, ...}, ...],
#     "page_count": 10,
#     "confidence": 0.98,
#     "model_id": "prebuilt-read",
#     "metadata": {...},
#     "error": None  # or error message if failed
# }

Environment Variables

  • Blob & Table: AZURE_STORAGE_CONNECTION_STRING (required)
  • Email (ACS): ACS_CONNECTION_STRING, EMAIL_SENDER
  • Document Intelligence: AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT, AZURE_DOCUMENT_INTELLIGENCE_KEY
  • Optional: AZURE_STORAGE_ACCOUNT_KEY, AZURE_BLOB_URL, AZURE_SAS_TOKEN

Optional Dependencies

All services are optional and won't break if their dependencies aren't installed:

# Base installation (includes all services by default)
pip install srx-lib-azure

# Or install only what you need - document intelligence is optional
pip install srx-lib-azure[document]  # Adds Document Intelligence support

# Install with all optional dependencies
pip install srx-lib-azure[all]

If you import a service without its required Azure SDK, it will log a warning but won't crash.

Release

Tag vX.Y.Z to publish to GitHub Packages via Actions.

License

Proprietary © SRX

Metadata

Release files for srx-lib-azure 0.5.1

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

Source distribution (sdist)

Source distribution for srx-lib-azure 0.5.1
File Size Uploaded
srx_lib_azure-0.5.1.tar.gz 16.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for srx-lib-azure 0.5.1
File Interpreter ABI Platform
srx_lib_azure-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 34.6 kB

Release files / srx_lib_azure-0.5.1.tar.gz

Download URL srx_lib_azure-0.5.1.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
df7b26aec9d631aabd8bcc01292d8a25203b749caeba8e4992a72e9badf9a0fc
BLAKE2b-256 checksum
How to use checksums
62fa47e801cc3082bcbbc7d32d6b0e6ed1d1e5495ccf5893391510394186c95d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / srx_lib_azure-0.5.1-py3-none-any.whl

Download URL srx_lib_azure-0.5.1-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ee4cfaa41be60bc93580f25844f747156c62b28820060bfe72d19d11e9cb8e5
BLAKE2b-256 checksum
How to use checksums
0edbea47891862493e8d5319a0958bdacac21c23fbd740d92f82b4f11da8b0ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

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