port79.client
Async Finger protocol client implementation.
DEFAULT_TIMEOUT
module-attribute
Default timeout in seconds for Finger network operations.
Client
Client(
*,
timeout: float | None = DEFAULT_TIMEOUT,
encoding: str = "utf-8",
)
An asynchronous client for the Finger protocol (RFC 1288).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
float | None
|
Default timeout in seconds for requests, or None for no timeout. |
DEFAULT_TIMEOUT
|
|
str
|
Default character encoding for response text. |
'utf-8'
|
__aenter__
async
__aenter__() -> Self
__aexit__
async
__aexit__(
exc_type: type[BaseException] | None,
exc_val: BaseException | None,
exc_tb: object | None,
) -> None
Exit the async context manager block.
request
async
request(
query: str | FingerURI,
*,
timeout: float | None = None,
encoding: str | None = None,
) -> Response
Send a Finger query request to a server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | FingerURI
|
Either a query target string (e.g. 'davep@plan.cat') or a FingerURI. |
required |
|
float | None
|
Optional timeout override in seconds for this request. |
None
|
|
str | None
|
Optional character encoding override for decoding the response. |
None
|
Returns:
| Type | Description |
|---|---|
Response
|
A Response instance containing the server output and query metadata. |
Raises:
| Type | Description |
|---|---|
URIError
|
If the query string cannot be parsed as a valid Finger URI. |
ConnectionError
|
If network connection to the server fails. |
TimeoutError
|
If the request times out. |