Skip to content

Context

Context

Context()

A shared context object for storing and accessing data across different processes.

Methods:

  • get_data

    Retrieves data from the context by key.

  • set_data

    Stores or updates data in the context.

get_data

get_data(key: str) -> Any

Retrieves data from the context by key.

Parameters:

  • key

    (str) –

    The key or identifier for the data.

Returns:

  • Any ( Any ) –

    The value associated with the key, or None if not found.

Example

files = context.get_data('collected_files')

set_data

set_data(key: str, value: Any) -> None

Stores or updates data in the context.

Parameters:

  • key

    (str) –

    The key or identifier for the data.

  • value

    (Any) –

    The data to store in the context.

Example

context.set_data('collected_files', ['file1.txt', 'file2.txt'])