Protocols

These runtime-checkable Protocol classes define the interfaces that custom artifact exporters and importers must satisfy. Use them with isinstance() to verify conformance at runtime.

ArtifactExporter

class django_snapshots.artifacts.protocols.ArtifactExporter(*args, **kwargs)[source]

Bases: ArtifactExporterBase, Protocol

Synchronous artifact exporter.

generate(dest: Path) None[source]

Write the artifact to dest. Must be a complete file on return.

AsyncArtifactExporter

class django_snapshots.artifacts.protocols.AsyncArtifactExporter(*args, **kwargs)[source]

Bases: ArtifactExporterBase, Protocol

Asynchronous artifact exporter — preferred for I/O-bound work.

async generate(dest: Path) None[source]

Async write the artifact to dest. Must be a complete file on return.

ArtifactImporter

class django_snapshots.artifacts.protocols.ArtifactImporter(*args, **kwargs)[source]

Bases: ArtifactImporterBase, Protocol

Synchronous artifact importer.

AsyncArtifactImporter

class django_snapshots.artifacts.protocols.AsyncArtifactImporter(*args, **kwargs)[source]

Bases: ArtifactImporterBase, Protocol

Asynchronous artifact importer.