Skip to main content

Azure Function State Storage

A simple key-value storage implementation using Azure Blob Storage as backend.

Features

  • Key-value storage with string values
  • Automatic container creation
  • Time marker functionality
  • Thread-safe operations

Installation

pip install az-func-state

Usage

from azfuncstate import AzFuncState

# Initialize with your connection string
conn_str = "YOUR_CONNECTION_STRING"
state = AzFuncState(connection_string=conn_str, container_name="mystate")

# Basic key-value operations
state.set("user:123", "active")
status = state.get("user:123")  # Returns "active"

# Time marker operations
state.set_time_marker("last_updated")
last_update = state.get_time_marker("last_updated")

API Reference

AzFuncState(connection_string: str, container_name: str)

Initialize the state storage.

  • connection_string: Azure Storage account connection string
  • container_name: Name of the container to use

Methods

set(key: str, value: str) -> None

Store a key-value pair.

get(key: str) -> Optional[str]

Retrieve a value by key. Returns None if key doesn't exist.

set_time_marker(key: str) -> None

Store current UTC timestamp under the given key.

get_time_marker(key: str) -> datetime

Retrieve a stored timestamp. Raises ValueError if key doesn't exist.

Requirements

  • Python 3.12+
  • azure-storage-blob package

Release files for az-func-state 0.1.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 az-func-state 0.1.1
File Size Uploaded
az_func_state-0.1.1.tar.gz 15.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for az-func-state 0.1.1
File Interpreter ABI Platform
az_func_state-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 30.9 kB

Release files / az_func_state-0.1.1.tar.gz

Download URL az_func_state-0.1.1.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
38a2788dc9e90f9a361df8468415114e3d6a355c8ad1cf6c5a68ad8275722c4c
BLAKE2b-256 checksum
How to use checksums
4a7100b851687ab3eb79e47d011f0880c2490c9bc0f3563439ecfe6b0866f35a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / az_func_state-0.1.1-py3-none-any.whl

Download URL az_func_state-0.1.1-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3597cc75d3ed0fbaf932ea06e7c5f687f664206edc9ed24966b2373cb37b0f2e
BLAKE2b-256 checksum
How to use checksums
24f5b929b4173fc766a60ca11689ba8de745954e61caa67126c9cb6c9da729d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.1.1 This release

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