Skip to main content
Version: Latest

Temporary Storage (st)

Temporary storage is used for temporarily storing data. All data is stored in RAM and is not preserved after restarting the system.

You can store absolutely anything, as this storage is based on a dictionary.

Access to local storage is available via mod.st.

Setting Values​

You can set a value either using the set method:

Arguments:

  • __key (str) - key
  • __value (Any) - value

Returns: None

Example:

mod.st.set('count', 20)

Or directly, like a regular dictionary:

Example:

mod.st['count'] = 20

Retrieving Values​

Retrieve values just like from a dictionary. Either using get:

Arguments:

  • key (Any) - key
  • default (Any) = None - Returned if the key is not found

Returns: Any - Value of the key

Example:

mod.st.get('count', 0)

Or like this:

Example:

mod.st['count']

Deleting Values​

Delete values using del:

Example:

del mod.st['count']