Skip to main content

quadkit-storage

Unified blob storage abstraction for Quadkit Framework — S3, GCS, Azure Blob, and local filesystem


Overview

quadkit-storage provides a unified BlobStore interface over Amazon S3, Google Cloud Storage, Azure Blob Storage, Cloudflare R2, and local disk — with signed URLs, streaming uploads, content-type negotiation, and server-side encryption. All services are wired via StorageProvider, which registers the blob store protocol with the DI container.


Full documentation: docs.quadkit.dev

Install

uv add quadkit-storage
# Optional extras
uv add "quadkit-storage[s3]"     # Amazon S3 (aiobotocore)
uv add "quadkit-storage[gcp]"    # Google Cloud Storage
uv add "quadkit-storage[azure]"  # Azure Blob Storage

Quick Start

from quadkit import Application
from quadkit.di.module import Module, module

# Import the module from the package
from quadkit.storage import StorageModule
from quadkit.storage.config import StorageConfig, StorageLocalConfig


@module(
    imports=[
        StorageModule.configure(
            StorageConfig(drivers={"local": StorageLocalConfig(root_dir="./storage")})
        )
    ]
)
class AppModule(Module):
    pass


async with Application.boot(modules=[AppModule]) as app:
    # use app.container to resolve services
    ...

Configuration

Zero-config usage: Call StorageModule.configure() with no arguments to use defaults.

Option 1 — YAML file

# application.yaml
storage:
  default_driver: "s3"
  drivers:
    s3:
      bucket: "my-app-uploads"
      region: "us-east-1"
      access_key: "${AWS_ACCESS_KEY_ID}"
      secret_key: "${AWS_SECRET_ACCESS_KEY}"
export QK_STORAGE__ENABLED=true
# Environment variables for each field

Option 3 — Python

from quadkit.storage.config import StorageConfig
from quadkit.storage import StorageModule

config = StorageConfig(default_driver="s3", ...)
StorageModule.configure(config)

Config reference

Field Default Env var Description
default_driver "local" QK_STORAGE__DEFAULT_DRIVER Active driver: s3, gcs, azure, r2, local, memory
drivers.s3.bucket — QK_STORAGE__DRIVERS__S3__BUCKET S3 bucket name
drivers.s3.region "us-east-1" QK_STORAGE__DRIVERS__S3__REGION AWS region
drivers.s3.access_key — QK_STORAGE__DRIVERS__S3__ACCESS_KEY AWS access key ID
drivers.s3.secret_key — QK_STORAGE__DRIVERS__S3__SECRET_KEY AWS secret access key
drivers.s3.endpoint_url null QK_STORAGE__DRIVERS__S3__ENDPOINT_URL Override endpoint (MinIO, LocalStack)
drivers.gcs.bucket — QK_STORAGE__DRIVERS__GCS__BUCKET GCS bucket name
drivers.gcs.credentials_path — QK_STORAGE__DRIVERS__GCS__CREDENTIALS_PATH Path to service account JSON
drivers.azure.account_name — QK_STORAGE__DRIVERS__AZURE__ACCOUNT_NAME Azure storage account name
drivers.azure.container — QK_STORAGE__DRIVERS__AZURE__CONTAINER Azure blob container
drivers.local.root_dir — QK_STORAGE__DRIVERS__LOCAL__ROOT_DIR Root directory for local storage
service.max_file_size_mb 100 QK_STORAGE__SERVICE__MAX_FILE_SIZE_MB Maximum upload size in MB

Module Factory Methods

Method Description
StorageModule.configure(config, enable_encryption) Configure with explicit StorageConfig
StorageModule.stub() Minimal config for testing

Key Features

  • S3 — Multi-part upload, server-side encryption, lifecycle rules
  • GCS — Resumable uploads, CMEK, uniform bucket-level access
  • Azure — Block blobs, shared access signatures (SAS), CDN integration
  • R2 — Cloudflare R2 (S3-compatible) support
  • Local driver — On-disk storage for development and CI
  • Memory driver — In-process storage for unit tests
  • Signed URLs — Time-limited GET / PUT pre-signed URLs for direct browser upload
  • Content negotiation — Automatic MIME type detection from extension and magic bytes
  • Key-value store — InMemoryKVStorage (memory) / LocalStorage (file) for small blobs (config, flags)
  • Streaming — stream() yields chunks for arbitrarily large files

Testing

async with Application.boot(modules=[StorageModule.stub()]) as app:
    # your test code
    ...

Key Source Files

File What it contains
src/quadkit/storage/module.py StorageModule class with factory methods
src/quadkit/storage/di/provider.py StorageProvider — wires storage protocols into DI container
src/quadkit/storage/config.py StorageConfig and sub-config classes
src/quadkit/storage/backends/ Driver implementations (AbstractDriver, S3, GCS, Azure, R2, local, memory)
src/quadkit/storage/kv/ KV backends (InMemoryKVStorage, LocalStorage)

Metadata

Release files for quadkit-storage 0.0.45

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

Source distribution (sdist)

Source distribution for quadkit-storage 0.0.45
File Size Uploaded Provenance
quadkit_storage-0.0.45.tar.gz 91.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for quadkit-storage 0.0.45
File Interpreter ABI Platform
quadkit_storage-0.0.45-py3-none-any.whl Python 3 none any Details

Total release size: 165.5 kB

Release files / quadkit_storage-0.0.45.tar.gz

Download URL quadkit_storage-0.0.45.tar.gz
Size 91.3 kB
Tags Source
SHA-256 checksum
How to use checksums
47c32a99648b3d222b2492fb4911a86517e14cbee4f2bb99f24c19c3f3f691cd
BLAKE2b-256 checksum
How to use checksums
d8ae93888f082b80b21ef3437c31bce376fd8fd22dd4c98eaf88c74e8b33fabc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / quadkit_storage-0.0.45-py3-none-any.whl

Download URL quadkit_storage-0.0.45-py3-none-any.whl
Size 74.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1250d886c671f83504d2394d28a5c3ad15a30f341de3e5a77136d1cbd9c43f29
BLAKE2b-256 checksum
How to use checksums
6d7c0aaa2a721a1e6a8d669c9944bc67c722887afb873261a85eb40bed9563b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for quadkit-storage 0.0.45

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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