Client SDK

Python SDK for HTTPActionServer.

HTTPActionClient(base_url, *, shared_secret=None) wraps a single requests.Session and exposes execute(actions) which POSTs the JSON action list to <base_url>/actions. The client is intentionally thin: it handles auth header assembly, response-code checking, and error translation, but makes no attempt to mirror ActionExecutor’s API surface — callers pass the same action-list shape they would pass to execute_action.

class automation_file.client.http_client.HTTPActionClient(base_url, *, shared_secret=None, timeout=30.0, verify_loopback=False)[source]

Bases: object

Synchronous SDK for a running HTTPActionServer.

Parameters:
  • base_url (str)

  • shared_secret (str | None)

  • timeout (float)

  • verify_loopback (bool)

property base_url: str
close()[source]
Return type:

None

execute(actions)[source]

POST actions to /actions and return the decoded JSON body.

Parameters:

actions (list | dict)

Return type:

Any

ping()[source]

Best-effort reachability probe — returns True if the server responds.

Return type:

bool

exception automation_file.client.http_client.HTTPActionClientException[source]

Bases: FileAutomationException

Raised when the server rejects a request or the response is malformed.