Closed lubaskinc0de closed 4 months ago
we can add a io.BytesIO loader like any existing bytes-like loader
io.BytesIO
from adaptix import Retort, loader, P @dataclass class Book: image: BytesIO data = { "image": b64encode(bytes(b"hello")) } retort = Retort( recipe=[ loader(P[Book].image, lambda x: b64decode(x)) ] ) book = retort.load(data, Book) print(book)
i'm work on it
we also can add provider for IO[bytes]
we can add a
io.BytesIO
loader like any existing bytes-like loader