Skip to content

Class swarmauri_core.git_filters.IGitFilter.IGitFilter

swarmauri_core.git_filters.IGitFilter.IGitFilter

Bases: ABC

Interface for git filters used by Peagen.

from_uri abstractmethod classmethod

from_uri(uri)

Create a filter instance from uri.

Source code in swarmauri_core/git_filters/IGitFilter.py
10
11
12
13
@classmethod
@abstractmethod
def from_uri(cls, uri: str) -> "IGitFilter":
    """Create a filter instance from *uri*."""

upload abstractmethod

upload(key, data)

Store data under key and return a URI or identifier.

Source code in swarmauri_core/git_filters/IGitFilter.py
15
16
17
@abstractmethod
def upload(self, key: str, data: BinaryIO) -> str:
    """Store *data* under *key* and return a URI or identifier."""

download abstractmethod

download(key)

Return a binary file-like object for key.

Source code in swarmauri_core/git_filters/IGitFilter.py
19
20
21
@abstractmethod
def download(self, key: str) -> BinaryIO:
    """Return a binary file-like object for *key*."""

clean abstractmethod

clean(data)

Store data and return an object identifier.

Source code in swarmauri_core/git_filters/IGitFilter.py
23
24
25
@abstractmethod
def clean(self, data: bytes) -> str:
    """Store *data* and return an object identifier."""

smudge abstractmethod

smudge(oid)

Retrieve the bytes for oid.

Source code in swarmauri_core/git_filters/IGitFilter.py
27
28
29
@abstractmethod
def smudge(self, oid: str) -> bytes:
    """Retrieve the bytes for *oid*."""