🎉 svc-infra v1.0 is here — Production-ready backend infrastructure
What's new
nfrax logonfrax

Infrastructure that just works. Ship products, not boilerplate.

Frameworks

  • svc-infra
  • ai-infra
  • fin-infra
  • robo-infra

Resources

  • Getting Started
  • What's New
  • Contributing

Community

  • GitHub

© 2026 nfrax. All rights reserved.

nfrax logonfrax
Start HereWhat's New
GitHub
svc-infra / API Reference

BaseLoader

from svc_infra.loaders.base import BaseLoader
svc_infra.loaders.base
Extends:ABC

Abstract base class for content loaders. All loaders are async-first with sync wrappers provided for convenience. Subclasses must implement the `load()` method.

Attributes

on_error: How to handle errors during loading. - "skip" (default): Log warning and skip failed items - "raise": Raise exception on first failure

Example

>>> class MyLoader(BaseLoader): ... async def load(self) -> list[LoadedContent]: ... # Implement loading logic ... return [LoadedContent(content="...", source="...")] >>> >>> # Async usage (preferred) >>> loader = MyLoader() >>> contents = await loader.load() >>> >>> # Sync usage (convenience) >>> contents = loader.load_sync()

Constructor
BaseLoader(on_error: ErrorStrategy = 'skip') -> None
ParameterTypeDefaultDescription
on_errorErrorStrategy'skip'—

Methods

On This Page

Constructoraiterloadload_sync