nvflare.app_common.psi.psi_spec module

class PSI(psi_writer_id: str)[source]

Bases: InitFinalComponent, ABC

The PSI interface is intended for the end-user interface to get an intersection of items of clients specified without knowing:

1) the details of PSI algorithms
2) real client's own items to other FL clients and FL Servers
Parameters:

psi_writer_id – a PSIWriter id, we will use it to get PSIWriter from engine. PSIWriter will be used save the intersection results. For example, FilePSIWriter implements PSIWriter interface and save to the local disk

finalize(fl_ctx: FLContext)[source]
get_intersection() List[str] | None[source]

This method will return the calculated intersection once PSI job is completed and successful.

Returns: Intersection result or None

initialize(fl_ctx: FLContext)[source]
abstract load_items() List[str][source]

This method needs to be implemented to provide the list of items to PSI algorithm in order to calculate intersection.

Returns: List of Items to be used for intersection calculation

save(intersection: List[str])[source]