pydalle.imperative.outside package

Submodules

This module contains all functions pydalle uses to interface with the filesystem.

pydalle.imperative.outside.files.read_bytes(file_like: Union[str, PathLike, IO[bytes]]) bytes
async pydalle.imperative.outside.files.read_bytes_async(file_like: Union[str, PathLike, IO[bytes]]) bytes

This module contains all functions pydalle uses to make requests to the internet.

pydalle.imperative.outside.internet.request(r: HttpRequest, /, session: Optional[Session] = None) HttpResponse
async pydalle.imperative.outside.internet.request_async(r: HttpRequest, /, session: Optional[aiohttp.ClientSession] = None) HttpResponse
pydalle.imperative.outside.internet.session_flow(__flow: Callable[[Any], Generator[HttpRequest, HttpResponse, T]], __headers=typing.Optional[typing.Dict[str, str]], /, **kwargs) T
async pydalle.imperative.outside.internet.session_flow_async(__flow: Callable[[Any], Generator[HttpRequest, HttpResponse, T]], __headers=typing.Optional[typing.Dict[str, str]], /, **kwargs) T

Async version of session_flow()

This module contains all functions pydalle uses to directly interface with PIL.

pydalle.imperative.outside.pil.bytes_to_masked_pil_image(image: bytes, x1: float, y1: float, x2: float, y2: float) module
pydalle.imperative.outside.pil.bytes_to_padded_pil_image(image: bytes, p: float, cx: float = 0.5, cy: float = 0.5) module

Shrinks an image by a given percentage. The actual image size does not change, but the image is scaled down by the given percentage and a transparent border is added to the edges.

pydalle.imperative.outside.pil.bytes_to_pil_image(image: bytes) module
pydalle.imperative.outside.pil.image_bytes_to_png_bytes(image: bytes) bytes
pydalle.imperative.outside.pil.pil_image_to_png_bytes(image: module) bytes

This module contains all functions pydalle uses which depend on the system’s random number generator.

pydalle.imperative.outside.sysrand.secure_random_choice(seq: SupportsLenAndGetItem[T]) T

Return a cryptographically secure random element from a sequence.

Module contents

This package contains all the modules which communicate with the outside world. Code outside this package but still within pydalle.imperative may use the modules in this package.