Skip to main content

network

Local network discovery helpers.

Deliberately free of any bitfount.federated import: the patient-data API (bitfount.patient_api.service) needs the private IP for a log line, and importing bitfount.federated.utils for it would pull in the whole federated package -- including Pod, which itself imports the patient API -- and so create an import cycle.

Module​

Functions​

get_private_ip_address​

def get_private_ip_address() ‑> str | None:

Get the private IP address of this machine, without raising.

Falls back to the last successfully-resolved address if the lookup fails, rather than reporting no address at all.

Returns None only if a lookup has never yet succeeded.