ebonite.core.objects.artifacts module¶
-
class
ebonite.core.objects.artifacts.Blob[source]¶ Bases:
ebonite.core.objects.artifacts.Blob,pyjackson.decorators.SubtypeRegisterMixinThis class is a base class for blobs. Blob is a binary payload, which can be accessed either through
bytestream()context manager, which returns file-like object, or throughmaterialize()method, which places a file in local fsMust be pyjackson-able or marked Unserializable
-
type= 'pyjackson.decorators.Blob'¶
-
-
class
ebonite.core.objects.artifacts.LocalFileBlob(path: str)[source]¶ Bases:
ebonite.core.objects.artifacts.BlobBlob implementation for local file
Parameters: path – path to local file -
type= 'local_file'¶
-
-
class
ebonite.core.objects.artifacts.MaterializeOnlyBlobMixin[source]¶ Bases:
ebonite.core.objects.artifacts.BlobMixin for blobs which always have to be materialized first
-
bytestream() → Iterable[BinaryIO][source]¶ Materializes blob to temporary dir and returns it’s file handler
Returns: file handler
-
type= 'ebonite.core.objects.artifacts.MaterializeOnlyBlobMixin'¶
-
-
class
ebonite.core.objects.artifacts.InMemoryBlob(payload: bytes)[source]¶ Bases:
ebonite.core.objects.artifacts.Blob,pyjackson.core.UnserializableBlob implementation for in-memory bytes
Parameters: payload – bytes -
type= 'inmemory'¶
-
-
class
ebonite.core.objects.artifacts.LazyBlob(source: Callable[[], Union[str, bytes, IO]], encoding: str = 'utf8')[source]¶ Bases:
ebonite.core.objects.artifacts.Blob,pyjackson.core.UnserializableRepresents a lazy blob, which is computed only when needed
Parameters: - source – function with no arguments, that must return str, bytes or file-like object
- encoding – encoding for payload if source returns str of io.StringIO
-
bytestream() → Iterable[BinaryIO][source]¶ Creates BytesIO object from bytes
Yields: file-like object
-
type= 'ebonite.core.objects.artifacts.LazyBlob'¶
-
class
ebonite.core.objects.artifacts.ArtifactCollection[source]¶ Bases:
ebonite.core.objects.artifacts.ArtifactCollection,pyjackson.decorators.SubtypeRegisterMixinBase class for artifact collection. Artifact collection is a number of named artifacts, represented by Blob’s
Must be pyjackson-able
-
type= 'pyjackson.decorators.ArtifactCollection'¶
-
-
class
ebonite.core.objects.artifacts.Blobs(blobs: Dict[str, ebonite.core.objects.artifacts.Blob])[source]¶ Bases:
ebonite.core.objects.artifacts.ArtifactCollectionArtifact collection represented by a dictionary of blobs
Parameters: blobs – dict of name -> blob -
type= 'blobs'¶
-
-
class
ebonite.core.objects.artifacts.CompositeArtifactCollection(artifacts: List[ebonite.core.objects.artifacts.ArtifactCollection])[source]¶ Bases:
ebonite.core.objects.artifacts.ArtifactCollectionRepresents a merger of two or more ArtifactCollections
Parameters: artifacts – ArtifactCollections to merge -
type= 'composite'¶
-
materialize(path)[source]¶ Materializes every ArtifactCollection to path
Parameters: path – target dir
-