Core¶
connect(streams, uri=None)
¶
Connect hetegeneous streams into a single stream.
Unlike stream.join
, this function can connect streams
with unique params, such as different renderers.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
streams |
list[AnyStream | GifStream | Mp4Stream | HtmlStream]
|
The streams to connect. |
required |
uri |
str | Path | BytesIO | None
|
The destination to write the connected streams to. If None, the connected streams are returned. |
None
|
Returns:
Type | Description |
---|---|
ConnectedStreams | Path
|
The connected streams if uri is None, otherwise the uri. |
Source code in streamjoy/core.py
stream(resources, uri=None, renderer=None, renderer_iterables=None, renderer_kwargs=None, extension=None, **kwargs)
¶
Create a stream from the given resources.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resources |
Any
|
The resources to create a stream from. |
required |
uri |
str | Path | BytesIO | None
|
The destination to write the stream to. If None, the stream is returned. |
None
|
renderer |
Callable | None
|
The renderer to use. If None, the default renderer is used. |
None
|
renderer_iterables |
list | None
|
Additional positional arguments to map over the renderer. |
None
|
renderer_kwargs |
dict | None
|
Additional keyword arguments to pass to the renderer. |
None
|
extension |
Literal['.mp4', '.gif'] | None
|
The extension to use; useful if uri is a file-like object. |
None
|
**kwargs |
dict[str, Any]
|
Additional keyword arguments to pass. |
{}
|
Returns:
Type | Description |
---|---|
AnyStream | GifStream | Mp4Stream | HtmlStream | Path
|
The stream if uri is None, otherwise the uri. |