Install & Compatibility
Where this runs
tested against v2.0.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
build_error
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.6s · import 0.000s · 28MB
26MB installed
● package 26MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
client
✓ import private_set_intersection
✗ from private_set_intersection import client
This example demonstrates how two parties (client and server) can compute the size of their set intersection using `openmined-psi` without revealing their full sets. The output will be the size of the intersection.
from openmined_psi import client, server
# Setup common inputs
client_inputs = ["client@example.com", "client2@example.com", "test@example.com"]
server_inputs = ["client@example.com", "server@example.com", "test@example.com"]
# --- Server side ---
# Create a server instance (e.g., with a new key)
server_psi = server.CreateWithNewKey(False) # 'False' means not to reveal the server's key
# Create a setup message. The first parameter is the FPR (False Positive Rate),
# the second is the number of elements in the server's set.
setup_message = server_psi.CreateSetupMessage(0.001, len(server_inputs), server_inputs)
# --- Client side ---
# Create a client instance
client_psi = client.CreateWithNewKey(False) # 'False' means not to reveal the client's key
# Create a request message from the client's inputs
request = client_psi.CreateRequest(client_inputs)
# --- Server side (handling request) ---
# Server handles the client's request
response = server_psi.HandleRequest(request)
# --- Client side (getting intersection size) ---
# Client processes the server's response to get the intersection size.
# Note: openmined-psi only provides the intersection *size* for privacy reasons,
# not the actual elements themselves.
intersection_size = client_psi.GetIntersectionSize(response)
print(f"Intersection size: {intersection_size}") # Expected: 2 (client@example.com, test@example.com)
Debug
Known issues
breakingThe Python package was renamed from `psi` to `openmined_psi` in version 2.0.3. Older import statements will fail.fixUpdate all import statements from `import psi` or `from psi import ...` to `import openmined_psi` or `from openmined_psi import ...`.
affects: <2.0.3
gotchaThe `openmined-psi` library is designed for privacy-preserving computation and will only return the *size* of the intersection, not the intersecting elements themselves. Attempting to retrieve the actual elements will result in an error or unexpected behavior.fixUnderstand that the library's privacy model is based on revealing only the intersection size. If you need the actual elements, `openmined-psi` is not the right tool for your use case.
affects: All versions
gotchaThe library requires Python 3.9 or higher. Installing or running `openmined-psi` on older Python versions (e.g., 3.8) will lead to installation failures or runtime errors.fixEnsure your Python environment is 3.9 or newer. Consider using a virtual environment to manage Python versions (`python3.9 -m venv .venv`).
affects: <2.0.0 (and versions before specific 3.11/3.12/3.13 support patches)
Upgrade
Version history
2.0.6latest on PyPI · released Jun 24, 2025
Audit
Dependencies
pythonrequiredRequires Python 3.9 or higher for compatibility.