Instance
Use discover to find Lablink instances on the network. The default address (https://127.0.0.1) points to the local server.
An Instance holds the server's address and optionally its metadata. Call get_info to fill in the name, version, and serial number.
Use login to start an authenticated Session.
from pypalmsens import lablink
local = lablink.Instance('https://127.0.0.1/')
info = await local.get_info()
# LablinkInfo(name=..., version=...)
session = await local.login('Alice', 'hunter2')
pypalmsens.lablink.Instance
A reference to a Lablink instance.
Exposes basic metadata through properties and provides get_info to refresh that information. Use login for an authenticated session.
Parameters:
-
(addressstr, default:'https://127.0.0.1') –The address of the instance (default is 'https://127.0.0.1').
-
(portint, default:5000) –Port to use on the instance (default is 5000).
Methods:
-
get_info–Fetch instance metadata from the lablink server.
-
login–Start an authenticated session with this lablink instance.
-
register_new_user–Register a new user account.
Attributes:
-
address(str) –The address of the instance.
-
info(LablinkInfo | None) –Last fetched metadata, or
Noneif not yet fetched.
Source code in src/pypalmsens/lablink/_instance.py
35 36 37 38 | |
info
property
info: LablinkInfo | None
Last fetched metadata, or None if not yet fetched.
May be stale or empty.
See get_info to (re)populate this.
get_info
async
get_info() -> LablinkInfo
Fetch instance metadata from the lablink server.
Returns:
-
LablinkInfo–Instance metadata including name, version and serial number.
Source code in src/pypalmsens/lablink/_instance.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
login
async
Start an authenticated session with this lablink instance.
Parameters:
Returns:
-
Session–A new session object for this instance.
Source code in src/pypalmsens/lablink/_instance.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
register_new_user
async
Register a new user account.
Parameters:
Source code in src/pypalmsens/lablink/_instance.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |