Storage

Overview

Storage is a class in Aspose.Html FOSS for Python.

Key-value store implementing the WHATWG HTML §12 Storage interface.

This class provides 6 methods for working with Storage objects in Python programs. Available methods include: __init__, clear, get_item, key, remove_item, set_item. All public members are accessible to any Python application after installing the Aspose.Html FOSS for Python package. Properties: length.

Properties

NameTypeAccessDescription
lengthintReadNumber of key-value pairs currently in this store.

Methods

SignatureDescription
__init__()Calls init on this Storage instance.
key(n: int)str | NoneReturn the n-th key in insertion order, or None if out of range.
get_item(key: str)str | NoneReturn the string value for key, or None if the key is absent.
set_item(key: str, value: str)Store or update a key-value pair.
remove_item(key: str)Remove the key-value pair identified by key.
clear()Remove all key-value pairs from this store.

See Also