Skip to content

src/dazzle_back/runtime/file_storage.py

Generated: 2026-03-30T04:38:47.230429+00:00

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

File storage backend for DNR.

Provides local and S3-compatible storage for file uploads. Metadata is stored in PostgreSQL via psycopg.

Key Exports

  • FileMetadata
  • StorageBackend
  • LocalStorageBackend
  • S3StorageBackend
  • FileMetadataStore
  • FileValidationError
  • FileValidator
  • secure_filename
  • FileService
  • create_local_file_service
  • create_s3_file_service
  • name
  • store
  • retrieve
  • stream
  • delete
  • get_url
  • name
  • store
  • retrieve

Dependencies

Imports

  • __future__.annotations
  • os
  • re
  • abc.ABC
  • abc.abstractmethod
  • collections.abc.AsyncIterator
  • datetime.UTC
  • datetime.datetime
  • pathlib.Path
  • typing.TYPE_CHECKING
  • typing.Any
  • typing.BinaryIO
  • uuid.UUID
  • uuid.uuid4
  • pydantic.BaseModel
  • pydantic.ConfigDict
  • pydantic.Field
  • psycopg
  • psycopg.rows.dict_row
  • aioboto3

Event Interactions

None detected.

Invariants and Assumptions

  • Validates: database_url is required. SQLite is no longer supported.

Tests

  • tests/unit/test_file_storage_pg.py
  • tests/integration/test_runtime_e2e.py
  • tests/integration/test_runtime_pipeline.py
  • tests/unit/test_runtime_test_routes.py
  • tests/unit/test_runtime_services.py

Notes

This page was automatically generated by tools/gen_reference_docs.py.