Module h2o_wave.core
Functions
clone_expando
Clone an expando instance. Creates a shallow clone.
Args
source
- The expando to clone.
exclude_keys
- Keys to exclude while cloning.
include_keys
- Keys to include while cloning.
Returns
The expando clone.
copy_expando
Copy all entries from the source expando instance to the target expando instance.
Args
source
- The expando to copy from.
target
- The expando to copy to.
exclude_keys
- Keys to exclude while copying.
include_keys
- Keys to include while copying.
Returns
The target 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 circular 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.
Returns
Either a Data placeholder or a packed string representing the data.
expando_to_dict
Extract an expando's underlying dictionary. Any modifications to the dictionary also affect the original expando.
Args
e
- The expando instance.
Returns
The expando's dictionary.
marshal
Marshal to JSON.
Args
d
- Any object or value.
Returns
A string containing the JSON-serialized form.
pack
Pack (compress) the provided value.
Args
data
- Any object or value.
The object or value compressed into a string.
unmarshal
Unmarshal a JSON string.
Args
s
- A string containing JSON-serialized data.
Returns
The deserialized object or value.
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
push
DEPRECATED: Use AsyncPage.save() instead.
Ancestors
Inherited members
AsyncSite
Represents a reference to the remote Wave site. Similar to Site except that this class exposes async
methods.
Methods
download
Download a file from the site.
Args
url
- The URL of the file.
path
- The local directory or file path to download to. If a directory is provided, the original name of the file is retained.
Returns
The path to the downloaded file.
load
Retrieve data at the given URL, typically the serialized form of a page.
Args
url
- The URL to read.
Returns
The serialized page.
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 circular 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 circular buffers.
Methods
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
Represents a reference to a remote Wave page.
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
sync
DEPRECATED: Use Page.save() instead.
Ancestors
Inherited members
PageBase
Represents a remote page.
Args
url
- The URL of the remote page.
Methods
add
Add a card to this page.
Args
key
- The card's key. Must uniquely identify the card on the page. Overwrites any other card with the same key.
card
- A card. Use one of the
ui.*_card()
to create cards.
Returns
A reference to the added card.
Subclasses
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
Download a file from the site.
Args
url
- The URL of the file.
path
- The local directory or file path to download to. If a directory is provided, the original name of the file is retained.
Returns
The path to the downloaded file.
load
Retrieve data at the given URL, typically the serialized form of a page.
Args
url
- The URL to read.
Returns
The serialized page.