fraudtwin.storage#

Local and fsspec-backed scale storage.

Status: Stable

Classes#

fraudtwin.storage.FsspecScaleStorage

S3/MinIO-compatible publisher backed by optional fsspec.

fraudtwin.storage.LocalScaleStorage

Filesystem implementation used by default and in CI.

fraudtwin.storage.ScaleStorage

Port used to publish a completed scale run.

Functions#

fraudtwin.storage.storage_for

Resolve a configured storage backend without importing optional packages.

Detailed API#

Storage ports for disk-first M18 runs.

The generator writes to a local staging directory and publishes completed files through this small adapter. Local storage is dependency-free; URI-based storage imports fsspec lazily and is therefore optional.

class fraudtwin.storage.FsspecScaleStorage(uri)[source][source]

Bases: object

S3/MinIO-compatible publisher backed by optional fsspec.

Parameters:

uri (str)

class fraudtwin.storage.LocalScaleStorage[source][source]

Bases: object

Filesystem implementation used by default and in CI.

class fraudtwin.storage.ScaleStorage(*args, **kwargs)[source][source]

Bases: Protocol

Port used to publish a completed scale run.

publish(local_root, destination)[source][source]

Publish local files below destination atomically where possible.

Return type:

None

Parameters:
  • local_root (Path)

  • destination (str | Path)

fraudtwin.storage.storage_for(uri, backend='local')[source][source]

Resolve a configured storage backend without importing optional packages.

Return type:

ScaleStorage

Parameters:
  • uri (str | None)

  • backend (str)