Skip to main content

Forester HTTP client (Python)

Python client for the Forester HTTP API. Forester embeds a small HTTP server that exposes the blackboard and the tracer to remote actions. This package talks to that server.

The client is generated from the OpenAPI specification produced by the Forester gen-openapi binary (cargo run --bin gen-openapi). The source specification is kept in clients/http/openapi.json.

Installation

pip install forester-client-http

Usage

from forester_client_http import ForesterClient

client = ForesterClient("http://127.0.0.1:46123")

# health
print(client.health())  # "OK"

# blackboard
client.put("count", 42)
assert client.get("count") == 42
assert client.contains("count") is True

value = client.take("count")  # 42, and the key is removed

client.put("config", {"timeout": 5, "tags": ["a", "b"]})
client.lock("config")
assert client.is_locked("config") is True
client.unlock("config")

# tracer
client.trace("robot armed", tick=3)
print(client.print_trace())

API

Method Endpoint
health() GET /
openapi() GET /openapi.json
get(key) GET /bb/{key}
put(key, value) POST /bb/{key}
take(key) GET /bb/{key}/take
lock(key) GET /bb/{key}/lock
unlock(key) GET /bb/{key}/unlock
is_locked(key) GET /bb/{key}/locked
contains(key) GET /bb/{key}/contains
trace(text, tick) POST /tracer/custom
print_trace() GET /tracer/print

Development

pip install -e .[test]
pytest

License

Apache-2.0

Metadata

Release files for forester-client-http 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for forester-client-http 0.6.1
File Size Uploaded Provenance Actions
forester_client_http-0.6.1.tar.gz 10.5 kB Without provenance Details for forester_client_http-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for forester-client-http 0.6.1
File Interpreter ABI Platform Actions
forester_client_http-0.6.1-py3-none-any.whl Python 3 none any Details for forester_client_http-0.6.1-py3-none-any.whl

Total release size: 21.8 kB

Release files / forester_client_http-0.6.1.tar.gz

Download URL forester_client_http-0.6.1.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
15230b9de2260fcd0e81e846e6a1a8171625df0f25da10d51e085246f6a3a5ab
BLAKE2b-256 checksum
How to use checksums
6566b9a7d40ac9cf88513d562389a23d18ff8100b9d06cda09b582e7eb5b3ad5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / forester_client_http-0.6.1-py3-none-any.whl

Download URL forester_client_http-0.6.1-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2189896da4968ed8443ce015c2e0f8d5df4f142ad93d4fbf0d584bdef081004b
BLAKE2b-256 checksum
How to use checksums
d875e86c82df622474fb31ccb78cb3ac554b0fcf18f8f992ceed8c84909d21b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for forester-client-http 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page