Module h2o_wave.core
Functions
clone_expando
copy_expando
data
Create a Data
instance for associating data with cards.
data()(fields, size)
creates a placeholder for data and allocates memory on the Wave server.
data()(fields, size, rows)
creates a placeholder and initializes it with the provided rows.
If pack()
is True
, the size
parameter is ignored, and the function returns a packed string representing the data.
Args
fields
- The names of the fields (columns names) in the data, either a list or tuple or string containing space-separated names.
size
- The number of rows to allocate memory for. Positive for fixed buffers, negative for cyclic buffers and zero for variable length buffers.
rows
- The rows in this data.
columns
- The columns in this data.
pack
- True to return a packed string representing the data instead of a
Data
placeholder. t
- Buffer type. One of 'list', 'map', 'cyclic' or 'fixed'. Overrides the buffer type inferred from the size.
Returns
Either a Data
placeholder or a packed string representing the data.
expando_to_dict
marshal
pack
Pack (compress) the provided value.
Args
data
- Any object or value.
The object or value compressed into a string.
unmarshal
Classes
AsyncPage
Represents a reference to a remote Wave page. Similar to Page
except that this class exposes async
methods.
Args
site
- The parent site.
url
- The URL of this page.
Methods
load
Retrieve the serialized form of this page from the remote site.
Returns
The serialized form of this page
save
Save the page. Sends all local changes made to this page to the remote site.
Ancestors
Inherited members
AsyncSite
Represents a reference to the remote Wave site. Similar to Site
except that this class exposes async
methods.
Methods
download
load
proxy
unload
uplink
Create or update a stream of images.
The typical use of this function is to transmit a stream of images to a web page, providing the appearance of a video. The path returned by this function can be passed to ui.image() or ui.image_card() (or even a custom HTML img element). The stream is displayed in browsers using multipart/x-mixed-replace content. Callers must call the unlink() function to signal end-of-stream.
Args
path
- a unique path or name for the stream (e.g. 'foo/bar/qux.png'). Must be a valid URL path.
content_type
- The MIME type of the streamed content (e.g. 'image/jpeg', 'image/png', etc.).
file
- A file or file-like object (on-disk file, standard I/O, in-memory buffers, sockets or pipes).
Returns
The stream endpoint, typically used as an image path.
upload
Data
Represents a data placeholder. A data placeholder is used to allocate memory on the Wave server to store data.
Args
fields
- The names of the fields (columns names) in the data, either a list or tuple or string containing space-separated names.
size
- The number of rows to allocate memory for. Positive for fixed buffers, negative for cyclic buffers and zero for variable length buffers.
data
- Initial data. Must be either a key-row
dict
for variable-length buffers OR a rowlist
for fixed-size and cyclic buffers. t
- Buffer type. One of 'list', 'map', 'cyclic' or 'fixed'. Overrides the buffer type inferred from the size.
Methods
dump
Expando
Represents an object whose members (attributes) can be dynamically added and removed at run time.
Args
args
- An optional
dict
of attribute-value pairs to initialize the expando instance with.
Page
PageBase
Ref
ServiceError
Common base class for all non-exit exceptions.
Ancestors
- builtins.Exception
- builtins.BaseException
Site
Represents a reference to the remote Wave site. A Site instance is used to obtain references to the site's pages.
Methods
download
load
proxy
unload
uplink
Create or update a stream of images.
The typical use of this function is to transmit a stream of images to a web page, providing the appearance of a video. The path returned by this function can be passed to ui.image() or ui.image_card() (or even a custom HTML img element). The stream is displayed in browsers using multipart/x-mixed-replace content. Callers must call the unlink() function to signal end-of-stream.
Args
path
- a unique path or name for the stream (e.g. 'foo/bar/qux.png'). Must be a valid URL path.
content_type
- The MIME type of the streamed content (e.g. 'image/jpeg', 'image/png', etc.).
file
- A file or file-like object (on-disk file, standard I/O, in-memory buffers, sockets or pipes).
Returns
The stream endpoint, typically used as an image path.